A 'ring' of push force

Been doing a bit of research and I cant find anything on using a reference point within a physics objects to push away other physics objects nearby in a radius of 360 degrees.

For example I have a sphere that is controlled by inputs. When a player pushes the mouse button any objects close to the sphere are pushed in a direction away from the centre of the sphere, but only along the X axis.

I can make inputs and move the sphere but I simply have no idea how i would script the ‘push’ function to act on nearby physics objects propelling them away from the sphere.

I understand that this may take a lot of code to write so even if you could point me in the direction of centain functions or variables I should be using.

Thanks.

I would suggest starting with Vector3.Angle() to find the direction between the two objects, then use Vector3.Distance() to get the distance as the force is probably going to drop off based on distance.

There’s an method in the RigidBody class that sounds right up your alley.

Thank you to both for the advice.

However the quote above is EXACTLY what i was hoping for.

Thanks :smile: