Hi Guys,
so I understand the NavMesh, however it's not the best way if you want your player ONLY be able to move left and right, not an inch top or down (basically like a sidescroller without jumping lol), I think?
Is there a good and easy way in AC to do that? The player should be able to click anywhere to the left or right of the character and it moves to that direction.
Hope it's clear what I mean ![]()
Cheers!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
*any other way than just make the mesh " as flat as possible" ofc
Welcome to the community, @Talez.
If you're using Direct movement, you can use the Player: Constrain Action to limit which direction the Player can be moved in.
When using Point And Click, however, a little custom scripting is necessary. You can find such a script over on the wiki here.
Hi mate, perfect, this is fantastic thanks!
I have one additional question though, but I think it has nothing to do with the Script. When I click somewhere, the character does move, but it jumps into a different direction first. Like:
I've set the walk/runacc/dec all to 1. Any idea why this could happen? Happy to share screens if you need!
Which way is the character facing before you click? Try checking both Turn before pathfinding? and Retro-style movement? in the Player's Inspector.
To rule out this being an issue specific to your Player, try also temporarily dropping in the 2D Demo game's Player prefab, Brain2D, into the scene to override your own, and see if he has the same issue. You can grab him from /Assets/AdventureCreator/2DDemo/Resources/Brain2D.
Retro Style Movement did the trick. Thanks again for your help, much appreciated. You have an awesome tool here!