Move along one axis

#1
Is there some way to force characters to move only along one axis (f.e. for sidescroller game)? Or maybe disable physics for other two axis at all?

The main problem for me is that the characters, while moving forward, slides in different directions if the terraint surface isn't ideally plate (even if on the character's way is a little few degree slope, it slides at side for a few centimeters).

Re: Move along one axis

#3
asfor wrote:You can use this FG :


No, I mean something else. I want, that character's can move only along one axis and no physical events can't change it.
For example, if i'm (or another actor) moving long y axis, then all the time value of an x axis should stay fixed and don't change no matter what happens
(well, like it has to be in sidescrollers)

Re: Move along one axis

#5
asfor wrote:Then maybe you can lock the ( X or Y ) pos to fixed number like this :


I've tried to do the same in code and it works very badly, because it has to assign new position to the entity every frame and animations go crazy.
I thought, maybe there is some default solution for fixing char. in "2D space".

Re: Move along one axis

#7
I would try to use an ActionFilter. You can define your own filters inside your ActionMap. After you did so, restart the editor and it should show up inside the Input:ActionMap:ActionFilter node. If you want to be moving only forward/backward, just disable the left and right movement inside your filter. If you only want to move to the side, disable the back and forth movement. And if you don't want the player to jump (z axis) then you can disable the jump action aswell. It's actually pretty simple to wrote a custom filter. Look into the default ActionMap inside the GameSDK project. You'll find the filters at the bottom. Their structure should be pretty self explaining.

- Jannis

Who is online

Users browsing this forum: Bing [Bot] and 1 guest