playMaker

Author Topic: Set Is Kinematic to all children.  (Read 925 times)

MAX_POWER

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Set Is Kinematic to all children.
« on: December 01, 2015, 12:44:14 PM »
Couldn't find an easy way to set Is Kinematic from Rigidibodies to all children. Example: Characters have a ragdolls and enabling/disabling kinematic from all rigidbodies that are children of the characters could be set by running one state from the character's fsm. I need to change the skeleton once in a while so I can't really set all the objects to be specific. At the moment I have FSMs to turn kinematic on in every bone that has the rigibody component and then use broadcast all global event. The problem is everytime I change the skeleton/character I need to copy paste the FSMs. Let me know if there is a way to do it already thanks.
« Last Edit: December 01, 2015, 01:12:17 PM by MAX_POWER »

dudebxl

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Re: Set Is Kinematic to all children.
« Reply #1 on: December 01, 2015, 05:21:14 PM »
Maybe, if i understand well, the enablecollider action might help you. You can set is ken on rigibody to all children from parent.

Action in ecosystem.

MAX_POWER

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Re: Set Is Kinematic to all children.
« Reply #2 on: December 02, 2015, 09:49:00 AM »
Hello and thank you for your reply. Enable collider seemed to do the trick.

MAX_POWER

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Re: Set Is Kinematic to all children.
« Reply #3 on: December 02, 2015, 02:56:51 PM »
Actually it doesn't work right. First of all the parent object needs to have a collider also or the script gives an error. It still works but I can't set the children to not be kinematic without disabling colliders from some of them aswell. Or if I try to set them to have colliders it will disable some of them from being kinematic. Not really sure what's going on but some weirdnes.

dudebxl

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Re: Set Is Kinematic to all children.
« Reply #4 on: December 02, 2015, 05:00:03 PM »
Hi,

I just tested with a cube and cube child, both with rigidbody and it works and i have corrected the warning errors (has no impact on gameplay - thanks for info). What you trying to do is a bit different than the purpose of the action. The action will set parent and (if true) all child. You don't need a collider (no impact) if you select only rigidbody from drop-down so I don't understand why/how collider is affecting the rigidbody (I also tested and no issue). I believe you have the wrong setup or you the action is not what you need.. Detect collision is turned off - maybe delete line 246 and tests to see is that helps(?)
« Last Edit: December 02, 2015, 05:08:48 PM by dudebxl »

MAX_POWER

  • Playmaker Newbie
  • *
  • Posts: 24
    • View Profile
Re: Set Is Kinematic to all children.
« Reply #5 on: December 03, 2015, 11:13:06 AM »
Hello, I'm not sure what's going on and why it doesn't work. You might be right that there's nothing wrong with the script. I just couldn't get it to work as intended. Tested out with deleting the line but didn't help. Somehow I can't get a trigger to detect one child even though everything should be just right. So I had to add a lot of fsm's and disable/enable colliders and rigidbodies with them. Thanks anyway might be helpfull script to other needs.