johnatm / itween

Automatically exported from code.google.com/p/itween
1 stars 2 forks source link

iTween does not work on objects that have both Rigidbody and CharacterController components #69

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add a cube to a scene
2. Add a character controller to the cube (overwriting the cube's default 
collider)
3. Add a rigidbody to the cube, mark the rigidbody as kinematic and does not 
use gravity
4. Add a script with an itween that moves the cube game object
ex.
iTween.MoveBy(gameObject, iTween.Hash("z", 10, "time", 5, "easetype", 
"linear"));

What is the expected output? What do you see instead?
I would expect that the cube would move forward 10 units in the Z over 5 
seconds. Instead it jerks forward choppily.

What version of the product are you using? On what operating system?
iTween 2.0.44 on Mac OSX 10.6.7

Please provide any additional information below.
If rigidbody or character controller is removed it works fine, but the combo of 
the two components on one object make it behave weird.

Original issue reported on code.google.com by justin.e...@gmail.com on 26 May 2011 at 2:17

Attachments:

seanbiganski commented 5 years ago

Hi, is there a resolution to this? I started a new project today and wanted to use iTween MoveTo but I need to detect various trigger collisions. Using a kinematic rigid body seems to prevent iTween from moving the object.

seanbiganski commented 5 years ago

In case someone else encounters this, I solved it by modifying the iTween script.

I changed this:

if(GetComponent() != null){ physics=true; }

to this:

if(GetComponent<Rigidbody>() != null && GetComponent<Rigidbody>().isKinematic == false) { physics=true; }

studio22M commented 5 years ago

Many blessings to you for sharing, this was very helpful, I would never have figured out this on my own and my project would have been delayed for several weeks .

anand27dixit-pixel commented 3 years ago

In case someone else encounters this, I solved it by modifying the iTween script.

I changed this:

if(GetComponent() != null){ physics=true; }

to this:

if(GetComponent<Rigidbody>() != null && GetComponent<Rigidbody>().isKinematic == false) { physics=true; }

Hi Would you please suggest on will line no to change this code in iTween.cs script?