Hello yes I would like an example script or code on how to attract one object to another object please?
We need to know more about what you’re trying to do. Are you trying to simulate gravity like planets? Are you trying to make a gravity gun? There are dozens of ways to fulfill what you’re asking here, we need more info.
Hi,
Are these rigid body physics objects or ones you are moving yourself each frame?
I am trying to attract an A.I pilot/Driver to an empty vehicle when the vehicle is empty and also to go back to its home base to a certain building which spawns vehicles also to allow the player to make the player AI to come out of their vehicles if the player wants them out or the player wishes to commandeer thier vehicles
I would say they are Rigid Body Objects as it is A.I Pilots/Drivers to vehicles
Ah, ok, but this is attraction in the sense of being a target destination for an autonomous entity as opposed to the sort of attraction between heavenly bodies that merely obey the laws of physics.
So we are more in the realms of A.I. and nav mesh navigation through a 3D environment. In that case, maybe take a look at Telling a NavMeshAgent to Move to a Destination.
Thank you very much