Why does my character move to a specific spot in the game world?
Hi there, I have a problem regarding movement in the Top-Down template, created for mobile. The idea of the game for players to tap on screen to move the character, like an action RPG, with the added feature of swiping across the screen to dash/dodge. But for some reason, my character moves to a specific spot in the game world, every single time.
Running the game would have it normal, like this:
But tapping anywhere, anywhere at all, will cause the character to move to this one spot and wouldn't respond to any input:
This is the blueprint for the game controller:
The "True" output of the branch goes to the dash/dodge blueprint, which works fine. Oddly, if I connect "Move to Hit Location" directly to either of the "Pressed" or "Released" output of InputTouch, it works fine. I couldn't understand why my character would go EXACTLY there; there was an obstacle there, but I removed it, and he still goes there (as if stuck to the wall, unable to advance further).
Thanks in advance!
P/S: Tap/swipe blueprint credit to this thread: https://forums.unrealengine.com/showthread.php?68473-Mobile-Touch-Swipe-Tap-amp-Dbl-Tap!-Get-it-here-for-free-)
According to your description, one of your nodes must be returning a NULL and stopping execution. The most likely one that I see is the Get Input Touch State, where you are always trying to get Touch 1, regardless of which touch actually happened. I recommend wiring up your Input Touch's output pin Finger Index to your Get Input Touch State input pin Finger Index and see if that fixes it.
If it doesn't, then just inserting a Print String between every node should help you find where your execution stops. Or you could try setting a breakpoint...but I haven't had good luck with that myself. (Nothing like trying to use a debugger...which crashes. :-/)
answered Jan 16 '17 at 07:02 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here