Answer by Borgo
Jan 13, 2011 at 06:20 PM
You can use joints. Try it!
OO fancy. Yes, thats prolly a better idea
Well, I want it to be invisible, so it looks like magnetism.
I've never unity before this... sorry if this is ridiculously noobish.
The joints are invisible and looks like magnetism, depends of type.
Answer by Bob5602
Jan 13, 2011 at 06:12 PM
What I would do..
Make 2 game objects, then put some kind of attraction force between them. Something like moving one object toward the other and vice versa, so they appear "attracted." Then make the amount of movement is inversely proportional to the distance (Vector3.Distance) between the two objects. Then, the closer they get, the faster they go!
Answer by efge
Mar 03, 2011 at 09:31 PM
I would suggest to also use Rigidbody.AddForce:
Attach a SphereCollider with a wider radius set as Trigger and a RigidBody to your GameObjects.
Use OnTriggerEnter to start Rigidbody.AddForce in the direction of the other object/collider.
Increase/decrease the added force depending on distance.
(When both GameObjects collide you could use a FixedJoint or parenting.)
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
No one has followed this question yet.
Setting Scroll View Width GUILayout
The name 'Joystick' does not denote a valid type ('not found')
Time.timescale cause extreme lag?
Show "Score:5" on my screen, how?