How to Change gravity to a certain Point.

I really need help with this. So I want to change the gravity on my game so that everything is attracted to the centre of the screen. Or another way would be to create a line and everything is attracted to that line. I really need help with this!

You will need to build your own gravity system for that kind of behaviour.

Every object that should be affected by gravity could have a script that does the following:

  1. Get the direction to the gravity source point: gravityCenterPoint - objectPosition;
  2. Apply a physics force or translate into that direction: Physics.AddForce into direction;

Then it’s only a matter of handling what happens with collisions. So by using AddForce and colliders, you have all the nice physics stuff, by using Translate you would have to write your own, which I don’t recommend. To make movement possible you would just multiply your movement velocity by the gravity velocity (moveDirection * moveSpeed * gravityDirection * gravityForce);