- Home /
Question by
Dartmor · Jun 03, 2015 at 02:38 AM ·
vector3constantforceinvert
GetComponent ().force = -Vector3.MoveTowards( transform.position, Vector3.zero, Time.deltaTime*speed);
GetComponent<ConstantForce> ().force = -Vector3.MoveTowards( transform.position, Vector3.zero, Time.deltaTime*speed);
I want the object to move not to Vector3.zero, but invert it. It doesn't work. What's wrong?
Comment
Best Answer
Answer by Eno-Khaon · Jun 03, 2015 at 03:20 AM
If you want your object to simply move away from (0, 0, 0), you can simply base it on your own position. To match the concept you already had, it would be:
GetComponent<ConstantForce> ().force = Vector3.MoveTowards( transform.position, transform.position * 2, Time.deltaTime*speed);
man it helped, still need to make some further changes but it's a progress