I have a floating part that follows a set of nodes using a VectorForce. The problem is that the part has pretty much no friction, so when the node path is curved the part drifts away from the desired path. How would I go about calculating a force that keeps the part in place while following the path?
You could reset the velocity once a node has been reached
That is exactly what I’m trying to avoid doing.
When you change the directions of the vectorforce, try negating the part’s momentum (mass * velocity) from the total force.
I would rather have a constant force that prevents the car from sliding away from the given path, similar to how a slip force prevents the car from spinning out while steering. The problem with this is that normally the slip force just negates the car’s object space X axis velocity, however the part I have following the nodes can be freely rotated which prevents me from doing that.
if i understand correctly, you want to negate the car’s object space X axis velocity without relying on the forward direction of the car? if so, try getting the desired forward direction of the car (which could be the unit vector of the node’s position subtracted from the car’s position), and assuming the upvector of the car is (0, 1, 0), get the cross product of the desired foreward direction of the car and the upvector. the cross product will be the right vector of the desired forward direction which you can then multiply by the magnitude of the car’s current velocity on that vector and then subtract that from the car’s total velocity.
lol im probably overthinking it, i hope i explained it well
Sorry for the extremely rate reply, but how exactly would I get the car’s current velocity “on that vector”?
I found a new solution to this. Negate the unit vector of the velocity from the desired direction, then apply the force with the unit vector of the result.
Does not seem to work for me sadly