Animating a cude

Dear all,

I new over here.

I am trying to develop a simple game in which the character is a cube and not a classic humanoid. I would like this cube to deform when pressing a button.

I do not know how to proceed. Should a built a skeleton or make an animation in blender or anything else???

Thanks a lot for your support.

You will probably want to make a blueprint class that inherits from ‘character’ and put a cube in it ( and a camera most likely ).

You’ll be able to move the cube around after including the usual control code ( which you can copy from the third person character ).

The cube can also respond to controls by changing shape, you just scale the cube depending on what key is pressed.

cube

1 Like

Thanks a lot @ClockworkOcean . But my cube is lying on the ground and when I use your technique, the vertical scale is done on Z+ and Z-.

Any other idea? Should I do an animation like for a charatere?

Hello,

The issue you’re having could probably be because the PIVOT POINT of the character is in the middle of the the mesh. So, if you set the Z scale to be 1.5, you get 1.5Z in one direction and 1.5Z in the other.

I would use the MODELING MODE to move the pivot point to the bottom of the cube so all Z transformation happens in one direction.

This is, of course, assuming I’m interpreting what you mean correctly. Your needs are still a little vague to me.

1 Like

Thanks @Leomerya12 .

This could work indeed I think.

Here is what I want to do:
CubeV

In Blender I create 2 animations:

  • 1 with the cube a the base form
  • 1 with the cube shrinked

Each time 2 keyframe but not modification in between.

I did the belwo animation BP:
image

With a state machine like:
image

In the BP_ThirdPresonCharactere BP I have added:

To be able to Set the variable and then a test like

But nothing happen?!

Any idea?

I found, be of like between charactere BP and skeleton mesh