playMaker

Author Topic: iTween doesn't work whenever the object has RigidBody?  (Read 588 times)

EsterionDev

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
iTween doesn't work whenever the object has RigidBody?
« on: March 15, 2018, 02:35:27 PM »
so as the title says how do I get it to work, or am I doing something wrong?

MattyWS

  • Junior Playmaker
  • **
  • Posts: 67
    • View Profile
Re: iTween doesn't work whenever the object has RigidBody?
« Reply #1 on: March 15, 2018, 03:10:44 PM »
It does work, can you send a screenshot of the settings for your rigidbody in the inspector?

EsterionDev

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: iTween doesn't work whenever the object has RigidBody?
« Reply #2 on: March 15, 2018, 05:56:38 PM »
Here ya go!

MattyWS

  • Junior Playmaker
  • **
  • Posts: 67
    • View Profile
Re: iTween doesn't work whenever the object has RigidBody?
« Reply #3 on: March 16, 2018, 03:13:06 AM »
do you need gravity?

Also the "is kinematic" checkbox may need to be turned on. :)

EsterionDev

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: iTween doesn't work whenever the object has RigidBody?
« Reply #4 on: March 16, 2018, 04:30:35 AM »
Thanks for that! and yes, I need gravity. help please? :)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3315
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: iTween doesn't work whenever the object has RigidBody?
« Reply #5 on: March 26, 2018, 04:41:25 AM »
Not at my computer to double check this, but I think you need to check Is Kinematic to allow iTween to control the Transform.

If that breaks Gravity you could try using Translate to recreate that movement.

Another option would be to try and reproduce what you're doing with iTween with forces instead e.g., Add Force. So you're not fighting the physics system.

I'll play around with this when I have access to Unity... there might also be a solution using Late Update...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13137
  • Official Playmaker Support
    • View Profile
Re: iTween doesn't work whenever the object has RigidBody?
« Reply #6 on: March 27, 2018, 10:51:45 PM »
Hi,

 Tweening engine and Rigidbodies are not meant to be used unless the tweening engine explicitly support Rigidbodies, and iTween doesn't support Rigidbody unfortunatly.

 The reason is that if you try to move a RigidBody by forcing its transform position or rotation, the Physics engine can not compute collision, joints, forces and torque properly.

Yes, if you check isKinematic, then you can control a Rigidbody with a Tweening engine, but you loose ALL the physics effect as a result ( like no gravity).

For moving and rotating a RigidBody and still have the Physics Engine be happy about it, there is a dedicated API for this, make sure you read the doc description to understand what it does

https://docs.unity3d.com/462/Documentation/ScriptReference/Rigidbody.MovePosition.html
https://docs.unity3d.com/462/Documentation/ScriptReference/Rigidbody.MoveRotation.html

These two api are supported with custom actions you can find on the Ecosystem.

PlayMaker here has nothing to do with this 'issue', it's a unity/Physics thing and whether or not the tweening engine takes RigidBody into account or not. ( that is using the api mentionned above).

DoTween Pro does mention it supports Rigidbody, I would enquire to the author of DoTween and ask wether yoru case can be done:

http://dotween.demigiant.com/pro.php

Maybe the free version does this, but It doesn't mention it. If you want I can investigate further if dotween properly tween Rigidbodies, but I would need to know more about your setup and what you intend to do with the tweening, so could you explain more about what you want to achieve?


 Bye,

 Jean


KKoontz

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: iTween doesn't work whenever the object has RigidBody?
« Reply #7 on: August 09, 2018, 04:04:41 AM »
Hello,

The links to the documentation in your reply do not work anymore and there is no reference to the API and what it does in the actual post. 

What API are you referring to?

miguelfanclub

  • Junior Playmaker
  • **
  • Posts: 72
    • View Profile
Re: iTween doesn't work whenever the object has RigidBody?
« Reply #8 on: August 09, 2018, 07:35:13 AM »
DoTween Pro has all the itweens actions for rigid bodies and non rigid bodies.