Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

Combine iTween with physics acceleration

$
0
0
I am trying to combine [iTween][1] with physics acceleration. ![top view of the path][2] Here is the top view of the path. The brown rectangle is made by a cube `GameObject`, with an `iTweenPath` component attached (4 nodes). The path is named `Path1`. On the left, there is a sphere (may not be seen clearly), which acts as the Actor, with `RigidBody` attached (mass = 3), was put few units above the floor. Then, I assigned a script to the Actor, which is: void OnCollisionEnter(Collision collison) { iTween.MoveTo(gameObject, iTween.Hash("path", iTweenPath.GetPath("Path1"), "time", 5)); } when the ball hits the ground due to gravity, it triggers the `iTween.MoveTo()`. The above works as expected. However, I want to combine with my physics acceleration script, which is: void FixedUpdate() { rigidbody.AddForce(transform.forward * 5.0f, ForceMode.Acceleration); } However, iTween governs the movement, made the `AddForce()` in `FixedUpdate()` no effect at all. How can I combine these two? [1]: http://itween.pixelplacement.com/index.php [2]: http://i.stack.imgur.com/cSd6F.png

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>