The faster it is, the farther it reaches. By the other hand, if something is slow, doesn´t travel that much in the same amount of time. My question is, how to travel small distances with a fast speed? Obviously with a smooth and slow deceleration, so it feels natural.
Is it possible to do it at half way?
Thanks for everything!
2 Answers
2umm. lets say you want to move your object 10 meters forward in 0.5 second (small distance with fast velocity)
i am thinking using Slerp ( for natural acceleration and deceleration) and RigidBody.addForce with forcemode VelocityChange
something like this :
if(Vector3.Magnitude(V) <25)
V = Vector3.Slerp(Vector3.zero,new Vector3(20,0,0),.25f);
else V = Vector3.Slerp(new Vector3(20,0,0),Vector3.zero,.25f);
gameObject.GetComponent<Rigidbody>().AddForce(V,ForceMode.VelocityChange);
Why else and why has to be less tan 25?
Why else and why has to be less tan 25?
– Feref2I don't quite get the confusion here. First of all the methods starting with "Do" are actually internal methods which are usually used by the actual method as they are defined in the [Handles API][1]. So the actual method is the "PositionHandle". Also "Slider" is the best fitting description for what it does. The Handles class is all about 3D GUI elements within the scene view. And a single draggable arrow / object along a single axis is a slider as it slides along that axis. What would be your description of such a handle? [1]: https://docs.unity3d.com/ScriptReference/Handles.html
– Bunny83