Let's put an end to this "Camera Jittering" Problem

KGBlag

  • Posts: 38
Ok, so I have an idea of why this is happening. It has to do with the order of the code I believe? I used to believe this was a problem with Stencyl until I read this: http://www.kinematicsoup.com/news/2016/8/9/rrypp5tkubynjwxhxjzd42s3o034o8 While explanations are given for unity users there is still yet to be a clear explanation to deal with it in Stencyl. 

I've successfully fixed the camera for the player character, placing the camera center block at the tail end of the code but I'm still confused as to how to apply this to other actors.  I'm trying to create a parallax actor that based off of the position of the camera but now I guess that mains the logic for that actor is placed after the camera I guess? Please, if anyone has experience with coding the camera proper it would be helpful for everyone  for an explanation as to how to use it. Thank you.

JeffreyDriver

  • Posts: 2262
Can you post a video of the problem or a link to your game? Just so I can see exactly what you're trying to do.

KGBlag

  • Posts: 38
I was trying to link a parallax actor to the X and Y of the camera local but as I've come to realize having code linked to the camera gets you something that looks like the gif below. I was able to get the player to keep with the camera so this has nothing to do with the actor itself but how the camera is coded or the relation actors have with the camera. I found that putting the  code for the camera last after the physics code works out fine. Actors the camera depends on or actors the actor the camera is coded with (dummy actor) also don't jitter but as soon an actor is dependent on the code of the camera or dummy actor then that actor jitters. 
This strange jittering has been discussed before in the forums but no clear instruction on how to prevent it has been given. It's been attributed to physics many times but I can affirm this just isn't the case most of the time. This image is from gamemaker so this isn't an isolated problem. I'd recommend at least skimming the linked article. 
The code for the parallax actor is also below. It would work as intended if it weren't for this jittering.

« Last Edit: January 14, 2019, 12:24:08 pm by KGBlag »