FPS Photon Bolt - line renderer start position is out of sync with gun???

Hey everyone! I have been following the photon bolt advanced tutorial along with some YouTube videos and I cannot figure out why the transform of my tracer origin is always out of sync with my gun position when moving like its delayed.

I have a simple child transform object named muzzle placed at the end of the gun barrel and this is how I create the tracer:

        if (_weaponStat.trail)

        {

          var trailGo = Instantiate(_weaponStat.trail, _muzzle.position, Quaternion.identity);

          var trail = trailGo.GetComponent<TrailRenderer>();

          trail.AddPosition(_muzzle.position);

          trail.transform.position = rh.point;

        }

Any help would be great :)

Best Answer

Answers