Quantcast
Channel: Latest Questions by dhendrix
Viewing all articles
Browse latest Browse all 42

Restricting movement on an axis from physics

$
0
0

I want enemies and objects to not move on the y-axis on account of physics, but I want to still be able to move them at will, such as in their update method. So I may want an enemy to move up and down on the y axis, but if the player bumps into him I don't want the enemy to go flying off into space because of a y axis offset. A configurable joint is amazing, but does not work to my knowledge, as I can't move the object at all.

I was thinking maybe something with Math.clamp, but I'm not sure if that's the best solution.


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>