All Questions

Community

W
Bernhard Werner

Aim Sprite Bug

When I start the game and aim at the ground, the Sprite3D for the cross-hairs rotates violently. Leaving and re-entering the aim state fixes it.
  • Nathan Lovato replied

    I'm sorry but I don't know why this is happening. This should be due to some line either in the Aim state or the AimTarget. Could you share your code here? I'll look at it and see if I can figure out the cause of the bug.

    You can use the </> icon to make code blocks.

    Code blocks like these preserve your code's formatting.
    
  • W
    Bernhard Werner replied

    On a whim I tried to change the last line in the AimTarget Script from

    look_at(collision_point - collision_normal, global_transform.basis.y.normalized())
    

    to

    look_at(collision_point + collision_normal, global_transform.basis.y.normalized())
    

    and now it seems to work... 🤷‍♀️