Got a model with a rigidbody, a move script and a basic raycast.
When the raycast comes into contact with an obstacle, i want the model to stop “forward” (the unit’s nose direction) velocity only. I want all other directional velocities to be unaffected.
when i say forward i do mean the objects own ‘forward’. if the model is falling or moving diagonally, it’s still only the forward i want to affect, not any other movement
JUST stop velocity in the direction of the nose of the object.
Is this supposed to be some sort of collision solution? Because these sort of methods don’t tend to work out very well.
Why does it have to be a raycast? Does it really have to have an infinite range? If not why not use a collider?
Same thing about why does it have to be a line? If not, a collider will be better as well.
If it needs to be infinite, and is more like a “beam that pushes us away from things” why not use a force on a rigidbody?