quick question about restricting movement...

Is there a way I can restrict the movement of an object so it is always moving in an ellipse that pertains to another object (think super mario galaxy) and still have all of my physics code work properly? things like AddForce, etc.

Basically the object always needs to be within a certain radius of another, which would make its movement elliptical.

I hope I’m making sense.

If i get your Question right, you want your Object to move in specific area, than these set of codes can help you …

if (transform.position.x >= 100.0) transform.position.x = 0;
else if (transform.position.x <= -100.0) transform.position.x = 100.0;

not quite. the object needs to move in an ellipse…like it’s orbiting another object.

this link can help

thanks, but i know how ellipses work. I just need to know if all my physics code will still work if i do this