Moving object to point

I have a list of Vector3 and a list of speed between each vector
I was looking through documentation and open projects, most people are using the rigid body for this.

Is there a simple function to translate an object from the current position to the target with a specific speed?
I don’t need any collision detection or anything, only moving and rotating to target

Hi @Dava,

I think the following example can be of help in this case, it uses the pc.Curve class to interpolate between a set of given points.

https://developer.playcanvas.com/en/tutorials/camera-following-a-path/

1 Like

Thank you for link , but since i am new with PlayCanvas , is there any simple function like in Unity :
transform.position = Vector3.MoveTowards(transform.position, Vector3Data[target], SpeedData[target]*speed);

Good, I think then you can do that easily with the PlayCanvas tween library. It’s quite flexible and in a sense an one liner with properties:

https://developer.playcanvas.com/en/tutorials/tweening/

You can also port the function over: https://github.com/Unity-Technologies/UnityCsReference/blob/61f92bd79ae862c4465d35270f9d1d57befd1761/Runtime/Export/Math/Vector2.cs#L87

1 Like