How to make a moveable object smaller using a keyframe?
I have been confused about scaling a moveable object using a keyframe.
I am trying to make a sphere smaller as it rolls along. To do this, I do the following:
1. Use a rotation sensor to get the overall angular velocity;
2. Put its output through a signal manipulator to clamp an angular velocity of 10m/s to an output of 1;
3. Put this output into a timer set to "speed", so that the ball will get smaller quicker when it rolls faster;
4. This output is then put into the keyframe, which is the scaled down sphere.
Here's where the trouble starts. When using a keyframe to scale the object down, all kinds of weird stuff happen. To avoid scaling on a global scale, I group the keyframe with my sphere. But if I animate it like this, the object is no longer moveable once it starts rolling. On a timeline, it is only moveable again after the scaling animation is completed, but I want the sphere to be moveable during the animation.
Finally, I tried John Beech's method of grouping an invisible sculpt with the sphere, animating the sphere in the group, then make the group moveable, not the sphere. This however makes the sphere bound to the physics of the other object. The invisible object will hit other objects, resulting in strange movement behaviour of the sphere as it is dragged along. Finally, I tried to make the invisible object non-collidable, but then the invisible object pulls the sphere through the ground as it is forced to move along with the invisible object.
I really am kind of lost here, so any input would be much appreciated!
You had it right with your first method. Just have it be in a group--no need for the extra sculpt, even an empty chip will do fine.
Then just make the group movable and affect the group with whatever movers and such you have going on. Now the group is the only thing movable, and the only thing you control. Then sculpt inside is used for visuals and for the collision shape and so on. So you can scale it up and down in there and the group will still use whatever sculpts are inside it for the physics simulation.
Thank you for your quick response!
Unfortunately I can't get it to work like this either. Once my sphere starts rolling, it will still be fixed in place as the scaling starts/when the keyframe turns on (and stays on).
I reckon it is because I accidentally save the position of the sphere within the group as well, is there any way around this so that I only store scaling information in the keyframe?
I made a video to show my issue, that might be a bit easier!
I'm trying to do the reverse here, which is scaling the snowball up as you roll it through the snow. The same principle should hold though, as I get the same weird results:
Oh freaky! Could be that it cannot properly update its angle of rotation if its contents change size and whatever. Also, it's scaling up and clipping into the ground which is making it collide and freak out too.
For testing, try adding a chip in the centre of the group and turn on "xray" (menu > show/hide) so you can see where the centre of the group actually is. My guess is the ball is somehow moving away from the centre of the group which is why it seems to lazily woblle around some other central point.
By the way, you can DM me through reddit/twitter/facebook messenger if I don't respond here for more than a day. Notifications don't work so well on this forum for now.
No worries about the response rate! I really appreciate your help ^^
So I tried recentering the group, having the chip stay in the center of the snowball and scaling the snowball from its center as well. Once the snowball moves, it'll keep moving at the pace of the initial push. Hence why I made a toggle to show how it all works perfectly fine when the keyframe is toggled off. Here's a vid showing that whole ordeal: https://youtu.be/VUQrnmXMnkc
I ended up finding a temporary fix that I deem good enough for now! There's probably a better way but it sort of works. I made a small microchip that pulses with a certain modulo rate, scaling the snowball up in steps. Picking a small enough modulo gives the desired effect, aside from a few hiccups here and there. I recorded that as well in case someone else stumbles across this thread :)
ooh--looks like it's working well!
I had thought it's possible in your case that other objects in the group could be causing issues.
I'm not sure if this would work but if you:
Create a sphere.
Place a chip beside it.
Group the two.
Place a keyframe outside of the group.
In record mode, scope into the group & scale the sphere.
Exit record & then scope into the group & delete the chip.
The sphere is now the only object in the group.
Make the sphere sculpt non movable within the group & make the group movable.
Thanks for the suggestion Cloud!
I tried following your steps, but the moment I delete the chip the sphere is ungrouped. I have not been able to keep the sphere grouped on its own sadly.
Sorry I thought that would work.
Another way to achieve it though might be to create two spheres, group them, scale them both using one keyframe to identical size within the group & then align them on top of one another, this may ensure the group centre won't move as the group can only be the size of the sphere.
No worries, it was worth a shot!
Your last idea gives some collision artifacts. This is avoidable when given both spheres labels and letting them not collide one another, but the physics engine will still treat them as separate objects. Because of this, a minor collision will result in the spheres bouncing away from each other, resulting in weird graphical glitches. Great idea though!
The odd thing is that only scaling is giving me some trouble here - other types of keyframing such as rotational or positional changes work flawlessly with the "grouping in" method.
Just a thought. When you animate the scaling, is the scaling done from the center of the object? If the scaling is done from the surface of the object, it will probably lose its position within the group.
Please sign in to leave a comment.