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
-
Hi @ThatGuyKeanu ,
Unfortunately, this does not seems directly related to Bolt, but as advise, this really depends on when and where you are invoking your code.
Just looking at this piece of code does not say much so it's hard to tell we can be it.
For effects like this, you can take a look at the example code from the "Advanced Tutorial" here: https://github.com/BoltEngine/Bolt-Sample/blob/master/AdvancedTutorial/scripts/Weapon/WeaponRifle.cs
It shows how to hook up the muzzle flash and trail effect from the tip of the weapon.
--
Ramon Melo
Photon Bolt Team
0
Answers
-
Hi @ThatGuyKeanu ,
Unfortunately, this does not seems directly related to Bolt, but as advise, this really depends on when and where you are invoking your code.
Just looking at this piece of code does not say much so it's hard to tell we can be it.
For effects like this, you can take a look at the example code from the "Advanced Tutorial" here: https://github.com/BoltEngine/Bolt-Sample/blob/master/AdvancedTutorial/scripts/Weapon/WeaponRifle.cs
It shows how to hook up the muzzle flash and trail effect from the tip of the weapon.
--
Ramon Melo
Photon Bolt Team
0