Using setLinkPoint and flip produces a flicker
by Patrick Shaw · in Torque Game Builder · 08/20/2006 (2:09 pm) · 0 replies
I have a character running with a mounted weapon. I am updating the weapon's link position so that the weapon tracks the character's hand as he runs. This scheme works until the character is flipped around to face the other direction. After flipping the character, the weapon flickers on both sides of the character.
Repro:
1. Create an animated sprite (%player) and a weapon (%obj)
2. Create a link point on %player
3. Mount %obj to %player.
4. Set the frame change callback for %player.
5. In the onFrameChange callback, use the setLinkPoint to change the link point on every frame.
>> The weapon tracks the mount point perfectly at this point.
6. use setFlipX to flip %player.
>> The weapon flickers on both sides of the character when the animation frame changes.
I have a demo in a week and a fix/workaround would be appreciated.
Thanks!
Repro:
1. Create an animated sprite (%player) and a weapon (%obj)
2. Create a link point on %player
3. Mount %obj to %player.
4. Set the frame change callback for %player.
5. In the onFrameChange callback, use the setLinkPoint to change the link point on every frame.
>> The weapon tracks the mount point perfectly at this point.
6. use setFlipX to flip %player.
>> The weapon flickers on both sides of the character when the animation frame changes.
I have a demo in a week and a fix/workaround would be appreciated.
Thanks!
About the author