How do I Stop Jerkiness of Scroll To behavior?

Get help using Construct 2

Post » Mon May 30, 2016 10:07 pm

So I have this character for my platform game and it has the standard scroll to behavior. It also has a run animation however each of the frames are different sizes so the changing sizes of the frame causes the scroll to behavior to be bumpy as it follows the player. How can I fix this or add a custom scroll to behavior?
B
37
S
14
G
3
Posts: 263
Reputation: 4,270

Post » Mon May 30, 2016 10:20 pm

Set the origin in each frame on the same place.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon May 30, 2016 11:06 pm

@99Instances2Go I tried that but it didn't change anything
B
37
S
14
G
3
Posts: 263
Reputation: 4,270

Post » Tue May 31, 2016 2:26 am

I would recommend making a "camera" object that the layout follows, rather than the character itself.

You can the set the position of the "camera" object;

Camera.X = lerp(camera.X,player.X,1-0.2^dt) : Change the 0.2 for a different speed (value between 0 and 1)
Camera.Y = lerp(camera.Y,player.Y,1-0.2^dt) : Change the 0.2 for a different speed (value between 0 and 1)

This will make the camera follow the player with a little bit of "smooth lag", and may fix your issue :)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Tue May 31, 2016 8:55 am

Still.

Better solve the cause. If the problem is what you allready dedected. Then i wonder if you let Construct decide over the Collission Polygones when you imported the frames. That is a bad habbit. You should check and make the polygones yourself. Or use a plain invisible sprite for the collisions and pin the animated player on it.

It is is not a good idea too to animate the collision poligones.
It is not a good idea to have differend framesizes for each animated frame.

To make all frames the same size. Find the frame with the biggest size in all animations. Note down the width & height. Choose any other frame. Click the 'size' button. Put widht & height in. Image: align center. Check the 'apply to whole animation' thingy. Do for all animations.

To set the origin the same for all frames. Right click the origin in the list of imagepoints. Choose apply to all animations.

To set the same polygones to all frames. Choose a frame. Set the polygones to your liking. Right click the sprite (with th poligones visible). Choose set to whole animation.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: Anna Nehves Br, divsyntax, oosyrag, volumetv and 16 guests