Announcement

Collapse
No announcement yet.

Limiting movement to 1 axis

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Limiting movement to 1 axis

    Hey everyone, I have been working on this for a while now and I cannot get it to work reliably. Here is the problem: I have been able to limit the player to only moving forward and backward and up and down. I do not want any player to be able to move side to side. I intercepted lateral movement started by the player and have stopped it. However, if the player walks into slanted wall, he will "slide" laterally, killing my whole "only on one axis" goal. Also, if the player gets hit by a grenade he will fly off the axis. So my question is does anyone know where to intercept all actor movement initiated by any source and keep it from moving from side to side all together?

    #2
    this isn't really a good answer, and it may not work, but maybe it'll inspire others to write better ones.

    the only thing i can think of would be to alter the tick function of the pawn, and each tick just set its acceleration, velocity, and location to whichever axis you want them to be locked to. that's about all i've got! hopefully there's something better out there...

    Comment


      #3
      Yeah I was thinking along the same lines, but I had not been able to get it to work yet. As far as I know, the only place where player location is set is in the Tick function, so any side to side movement would have to be set there. This has become such a sticking point for me and is making me crazy. Thanks for the response!

      Comment

      Working...
      X