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.
asked Nov 13 '18 at 06:37 PM in Blueprint Scripting
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.
answered Nov 13 '18 at 09:14 PM
Highly appreciate your answer, unfortunatelly it did not work :(
answered Nov 15 '18 at 08:26 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here