0
Answered

How to make slide animation for camera?

YeetLordSupreme 6 months ago in Game Creator updated by Marti (Lead Developer) 6 months ago 1

Hi there,

So I just very recently got Game Creator, and while I have to say I am quite enjoying the simplicity of working with it, there are a few things that I can't seem to get to work correctly.

One of these is the camera.  I would like my player character to be able to slide after sprinting for a short distance.  Using actions and triggers I was able to make the character itself do this quite easily.

However, as I am using a first-person camera motor, I would like the camera itself to also be animated, so when the player slides, the camera moves slightly closer to the ground with it, and thus the slide is visibly apparent to the player.

Yet, no matter what I do, it seems I cannot animate or move the camera by any means that are not already pre-defined in the camera motor.  If i turn the motor off completely, then yes, I can animate the camera, but I would very much like to not disable the motor, as that opens up a host of other problems.

Anyone have any ideas?  All I need is to move the camera up and down slightly on a button press, essentially.  Thanks.

Unity version:
2019.3.3f
Game Creator version:
Latest

Answer

Answer
Answered

In this case, I believe the best solution would be to use two FPS Camera Motors. One is the one that has head-bobbing and used while playing normally. When sliding, use the Change Camera Action to switch to the other FPS Camera Motor that has no head-bob (since sliding shouldn't bounce the camera to the sides) and the Y offset is lower, so it's closer to the ground.

Remember to set a transition duration higher than 0. For sliding, I'd suggest a value of 0.3 or so, since it's a fast movement. Then, add a Wait action of 1 or 2 seconds and change back to the main camera motor with a duration a bit higher (like 0.5).


Hope this helps!

GOOD, I'M SATISFIED

Good answer, thanks!  Didn't realize you could just change the Y offset like that...I ended up simply writing a script to change the Y offset value over time when the player slides, and it works great.  

Satisfaction mark by YeetLordSupreme 6 months ago
Answer
Answered

In this case, I believe the best solution would be to use two FPS Camera Motors. One is the one that has head-bobbing and used while playing normally. When sliding, use the Change Camera Action to switch to the other FPS Camera Motor that has no head-bob (since sliding shouldn't bounce the camera to the sides) and the Y offset is lower, so it's closer to the ground.

Remember to set a transition duration higher than 0. For sliding, I'd suggest a value of 0.3 or so, since it's a fast movement. Then, add a Wait action of 1 or 2 seconds and change back to the main camera motor with a duration a bit higher (like 0.5).


Hope this helps!