3
$\begingroup$

I have a cylinder object falling and hitting pins as a game element, I want to make it rotate on the 'Y' axis as it does so in order to look more realistic. Tried keyframes but it must not work on an object with Rigid Body? Any ideas?

enter image description here

enter image description here

$\endgroup$

2 Answers 2

0
$\begingroup$

You could have 2 cylinders of the same size, put them at the same location, give the Rigid Body to one of the 2 cylinders, make it invisible, don't give any physics to the other one but parent it to the first one and keep it visible. Give it a rotation animation on Y, it will follow the first one and it will rotate on itself.

$\endgroup$
5
  • $\begingroup$ Awesome thanks, this works also! $\endgroup$
    – Diarmuid
    Jul 6 at 10:00
  • $\begingroup$ If the cylinder sometimes falls to one side and sometimes to the other it would look quite unrealistic if the Y rotation always keeps spinning in the same direction. And if you would change the animation manually according to the way of the rigid body, you can just as well animate it all like that and completely abandon the animation. $\endgroup$ Jul 6 at 12:46
  • $\begingroup$ @Gordon Brinkmann You can change the direction at some moments, but I'm not sure what you mean with your second phrase, maybe propose an answer, I've tried to mix animation and rigid body with the Animated option on and off but I couldn't make it work correctly... $\endgroup$
    – moonboots
    Jul 6 at 13:12
  • $\begingroup$ @moonboots What I mean is, if a real cylinder would fall through these obstacles, it would not just spin all the time, the spin would be dependent on how it hits one obstacle after another. Simply animating a rotation by keyframe would be far from realistic. Chris' answer is okay so far - I just don't understand why the OP's doesn't seem to rotate at all, at least rigid bodies have some friction by default... $\endgroup$ Jul 6 at 13:35
  • $\begingroup$ sure I think that Chris' answer is probably the best, but if for some reason the OP chooses to keyframe the cylinder he can still create as many keyframes as he wants and change the Y direction at some point, etc $\endgroup$
    – moonboots
    Jul 6 at 13:55
4
$\begingroup$

This works "alone" by physics, if you give both, the cylinder and the obstacle, just more friction:

enter image description here

result:

enter image description here

i "cheated" here just a bit by locking some location and rotations so the cylinder doesn't fall out.

enter image description here

Of course you could also solve this by adding a second "transparent" plane with rigid body passive in front.

Blend file to check it out:

$\endgroup$
5
  • $\begingroup$ Thanks a lot, was wondering if it was possible with just rigid body, will play around with settings! $\endgroup$
    – Diarmuid
    Jul 6 at 10:00
  • $\begingroup$ @Diarmuid If you want to give it some more rotation as if it started falling while already spinning, go to frame #4 and hover your mouse over the (disabled) Animated checkbox in the Rigid Body settings. Hit "i" to insert a keyframe. Then go to frame #3 and set a keyframe for the rotation of the object. Now go to either frame #1 or #2, check the Animated option and press "i" on it again. Select the object and rotate it slightly and insert another rotation keyframe for it. Depending on the frame and how much you rotated it it will have more or less initial spin. $\endgroup$ Jul 6 at 12:41
  • $\begingroup$ @Chris Your solution is the way to go, it doesn't make sense like in the other answer to animate the rotation of a second cylinder independently from the falling rigid body. $\endgroup$ Jul 6 at 12:48
  • $\begingroup$ Depends what you want to have …if the OP is happy with it - I am happy with it too…💁🏻‍♂️ and with 4 upvotes I even got more reps than the correct answer check 😉 $\endgroup$
    – Chris
    Jul 6 at 12:50
  • $\begingroup$ @Chris As I just commented on moonboots: what I don't understand why the OPs setup doesn't rotate at all... the default rigid bodies already have some friction. The animation in the question looks like a particle falling, not a rigid body. $\endgroup$ Jul 6 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.