Move camera upwards when character looks up (SOLVED WITH TWEENING)

Hello. It’s me again. :confused:
My character has an animation where he looks upwards when the up button is held. I would like for the camera to move upwards a little when he looks up. I would also like the camera to move smoothly as well. When the up key is let go, the camera moves back to the player’s position. I tried to attempt this, but unfortunately failed. Does anybody know how to do this?

Note: My camera is it’s own object that always stays at the center position of the player and remains hidden at all times.The camera follows the invisible object attached to the player, not the player itself (This is so other mechanics in my game work correctly). Is it possible to move the camera object upwards by changing it’s Y position as long as the button is held? Thanks in advance.

1 Like

Ah…That’s hard when need a smooth transition dude.
I also want to know this.

Please? Does anybody know how? I really need help with this… :slightly_frowning_face:

Nevermind everyone! I just decided to give up on waiting for an answer and just do it myself.
Now with the new tweening behavior added in version 66, I was able to easily create exactly what I wanted in no time at all! :slight_smile:
Seriously, tweening is a GODSEND. I’m not sure how we all managed before it was added!


How you did? Please make a post about that. (showing your events)

Here you go (and sorry for the late reply)

For this setup, you need 3 objects: The player, a “Camera” object, and a “LookUp” object. Also, please note that these events are underneath the player’s logic.
Give the camera object the Tween behavior and tween the position of it to the Player’s center. For easing, I used “linear” over 400ms, but you can change this to whatever suits you.
Now, rather than center the camera on the player, center it on the camera object.
Now take your “LookUp” object and position it above the player as high as you want him to look up. For this example, I chose 150 pixels above the player.
Now make sure that at the beginning of every scene, that you create the camera and lookup objects, and hide them. Put this underneath the Player Logic to save time and optimization.

Now, when the character is looking up, tween the position of the camera to the center of the lookup box, using whatever easing and ms you prefer. When the player stops looking up, tween the position of the camera back to the player.

Finally, underneath the events that actually make the character look up (Which I assume you have already done), create a sub event that positions the camera object to the X position of your player. This makes sure the camera doesn’t go doing it’s own thing. If the character is looking up while moving, make sure you put a sub event with the same actions below that as well.
That should be about all. Hope this helps.


Oh…Thanks a lot @Shadowbonnie7.:smiley:

No problem mate. Did it work?

1 Like

Yes. And tween animations are really great

I’m pretty new to this and a bit late. Was working on a camera set up though and thought it might be useful for someone. I have the camera focused on a hidden object. There’s a condition that if the object is further than 5 pixels from the player, it will travel towards the player. The speed I put was the distance between the object and player +100. This seems to work pretty good for a smooth camera. Another condition is that if the the player is more than 200 pixels away, the speed is the distance between the objects *1.5. This allows the camera to keep up with falls smoothly. If I wanted to look up I could set a point above the player and have a condition to travel there when the L stick is up. When it’s released it would just go back to following the player smoothly. Works great and all you need is one hidden object.