Constrained actor's falling behind when moving

JonTiStudiosJonTiStudios Member Posts: 66
edited November -1 in Working with GS (Mac)
Here's the setup:

I have a smaller sized actor set up (for collision purposes) and have global attributes reading it's position and angle. I have my main actor constrained to these attributes.

Of course the reason I'm doing this is I need my main actor to have a smaller collision area than the whole image.

Now the problem I'm running into here is that the constrained actor falls behind about 5-10px when moving fairly quickly. (Fairly quickly being about 200-300 acceleration speed) It appears to slowly move further back and finally stops around 5-10px behind.

Not only is it not staying aligned with my collision actor, but the graphical actor also often "pops" around while trying to remain constrained. The image will flash a few pixels behind, then back to (close to) where it's supposed to be creating a very ugly flashy effect I do not want.

I have tried flooring the attributes, but it doesn't seem to make much difference.

I'm open to any suggestion. Thanks!

Comments

  • rebumprebump Member Posts: 1,058
    A few pixels of "fall behind" are normal (if you want to call it that) from my tests. The more your app has going on, the bigger the gap.

    Have you tried making the collision follow the visible actor? The effect may seem more natural that way. Right now, you have the collision area ahead, maybe even having some blank pixel space between the two causing "pre" collision. If you reverse who follows who, you will get "post" collision but that may be acceptable if you play your cards right (i.e. the visible actor is large enough whatever collides with it won't pass through it before collision, you set the layer altitude of the actor in question higher than the others in the layer order so it will be visible over otheres that are colliding with it...thus hiding the "post" collision a bit, etc.).

    Just something to try since you won't get rid of it entirely even with a stripped down app. Either that or reduce the speed a bit - that usually helps a bit as I think you found out.
  • JonTiStudiosJonTiStudios Member Posts: 66
    Thanks for the suggestions.

    Unfortunately, the collision is for the purposes of physics. It's the "base" of the main actor to determine it traveling on the "ground". Due to this the graphical actor needs to be constrained to the invisible collision actor. And I don't really want to reduce the speed as the point of the game is the speed really.

    Thanks though for the suggestions.

    I find it a bit ridiculous to have such a massive gap. Especially when the whole thing (during a test) is just a few actors and not much else. This is really noticeable when I offset the graphical actor from the collision actor with formulas to properly rotate around the collision actor. The 5-10 pixels makes my graphical actor rotate around the complete wrong spot.
Sign In or Register to comment.