x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Topdown mouse movement not possible on other pawns other than starting one

Greetings, I am trying to create a topdown game where the player will use multiple characters, one at a time. Right now am using the posses on get player controller in order to switch between characters. I have searched some other tutorials and questions around the net, and nothing seems to be quite alike my problem, I have disabled the mouse to touch, enabled click events, enabled input for the possessed character and so on... The thing is, the mouse movement only works on the first character possessed by the player, when switching character, it stops working and than just works again when switches back to starting one. WASD controls works fine on any character.

Please let me know if any further information or screenshot is needed.

Product Version: UE 4.20
Tags:
more ▼

asked Nov 13 '18 at 06:37 PM in Blueprint Scripting

avatar image

MarcosFernandes
1 1 1

avatar image mightyenigma Nov 13 '18 at 08:19 PM

Yes I think code screenshots are needed

avatar image MarcosFernandes Nov 13 '18 at 08:39 PM

Alright, so this is the char possession function, the topdown character has a variable called "CharIndex" which is an integer and is unique for each character ranging from 0 to 4. The loop compares the element with the given integer in order to get a specific one and when it does it gives the player possession of such character. This funcion is called from the GameMode.

Char Possession Function

This is how the topdown character details are set

Topdown Char Details

When a character is possessed, than it spawns an inventory and set the cursor to visible, when it is unpossessed, it makes the cursor invisible and stops any movement.

On char possessed On char unpossessed

I don't know what other info are needed to screenshot, let me know which blueprints if any more is needed.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

In your CharPossession event, I wonder if the array element is out of scope when you break the for loop. Maybe you need to Promote the current Array element of the foreachwbreak loop to a variable, and set it between the True branch and the Break pin. Then in the nodes after the Completed pin that use that reference, connect them to the variable and not directly to the array element output pin of the foreachwbreak loop node anymore.

That way you can ensure that the Actor reference being used by those nodes after the loop, is in scope and points to an actual actor, and not something that only had a valid reference within the loop.

If that doesn't fix it then something else is also wrong.

more ▼

answered Nov 13 '18 at 09:14 PM

avatar image

mightyenigma
3.8k 18 23 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Highly appreciate your answer, unfortunatelly it did not work :(

more ▼

answered Nov 15 '18 at 08:26 PM

avatar image

MarcosFernandes
1 1 1

avatar image mightyenigma Nov 15 '18 at 08:45 PM

Hmm then something else is also wrong....

avatar image MarcosFernandes Nov 16 '18 at 01:51 AM

I can't figure at all

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question