playMaker

Author Topic: A rigid body doesn't fall under gravity  (Read 1365 times)

Benjiboy

  • Playmaker Newbie
  • *
  • Posts: 7
A rigid body doesn't fall under gravity
« on: September 26, 2020, 06:18:17 AM »
I am new to playmaker, unskilled at Unity, am following Johnathon O'Duffy's course.
My question: When my character cube dies, I want an animation where it falls on it's back. iTween Rotate To with X=-90 puts the player on it's back, but because it is an up right slab, rather than a cube, and the rotation is about it's centre, it is now floating. I expected the rigid body would make it fall to the floor, but it doesn't.
Can someone more knowledgable than me offer some advice, please?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: A rigid body doesn't fall under gravity
« Reply #1 on: September 26, 2020, 06:42:23 AM »
hi.

2 thing you can do :

1 Set pivot point of you mesh to bottom (inside 3d program, is you use a custom mesh)

2 make a empty object and move the position to the bottom, then set you object that has the mesh as a child on that object.
then rotate the empty object

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 254
Re: A rigid body doesn't fall under gravity
« Reply #2 on: September 26, 2020, 10:49:56 PM »
hmmm that is weird, this should be working as intended. Are you sure kinematic is not set?

I tried with several rotation animations (iTween Rotate Add, iTween Rotate To, Dotween Rigidbody Rotate, Dotween Transform Rotate, as well as in combination with a small upwards force (Add Force) and the physics do the rest.

Or the other thing that might be messing is the collider box that hasn't the form of your 'up right slab'?
« Last Edit: September 26, 2020, 10:52:03 PM by Christoph »

Benjiboy

  • Playmaker Newbie
  • *
  • Posts: 7
Re: A rigid body doesn't fall under gravity
« Reply #3 on: September 27, 2020, 01:17:37 PM »
Hmm. I checked iskenematic and sure enough it was happening before the rotate. I suspect that what I need to do is force everything to wait for a collision between my character and the floor, after doing the rotate.

Christoph

  • Beta Group
  • Sr. Member
  • *
  • Posts: 254
Re: A rigid body doesn't fall under gravity
« Reply #4 on: September 28, 2020, 10:27:38 AM »
If you have Kinematic checked it never will fall to the floor. It needs to be unchecked.

Benjiboy

  • Playmaker Newbie
  • *
  • Posts: 7
Re: A rigid body doesn't fall under gravity
« Reply #5 on: September 30, 2020, 10:30:00 AM »
Well, I moved the iskinematic setting to the end of the stack.
Now what happens if the character cube is collided with from above, is that it sinks slightly into the floor beneath it, bobs back up, then rotates on to it's side and sinks down to the floor. Much closer to what I want, but I don't understand the sinking and bobbing bit.