Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Vuforia Camera Projectile Issues

Discussion in 'Vuforia' started by James-Williams, Mar 29, 2018.

  1. James-Williams

    James-Williams

    Joined:
    Aug 30, 2016
    Posts:
    26
    Does anyone have any tips on launching projectiles from an AR camera to a target on an image target. Firing the projectile and instantiating the target on the image target is no issue.

    The logic works fine. The issue is that the projectile wobbles a when the center is set to First Target and its sorta fine when set to World. Even that I can sorta live with. However, when a projectile is fired (no parent || child of image target || child of AR camera ) if I move the camera left or right (webcam or phone), the projectile moves left or right with the camera. Even when set to world which throws off the intended tragectory.

    I have read about camera Matrix and so on but I have no idea how to over come this issue. I watched a few gameplay videos and noticed the same behaviour in other games.

    How can I get the projectile to stay the path and ignore the motion of the camera once it is launched? Any suggestion?
     
  2. N-Dev-Games

    N-Dev-Games

    Joined:
    Mar 11, 2009
    Posts:
    328
  3. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    My recommendation would be to generate the projectile at the location of the camera, but attached as a child object to a target that is set to be the world center (either the first or a specific). Since the target is the world center and the camera will be moving around it, the projectile should move in the direction originally fired and shouldn't move with the camera.

    Did you try something similar to these and are seeing the projectile move with the camera?