Open wkyfasttank opened 3 months ago
What happens if you flip
instance.gameObject.SetActive(true);
instance.transform.position = startPoint;
to
instance.transform.position = startPoint;
instance.gameObject.SetActive(true);
I do remember facing this issue at one point. If you clear the trail that is also a perfectly acceptable solution if my suggestion does not work.
It work,thank so much.
When I was writing code following your first gunfight system tutorial, I found that after firing a few shots, the bullet trajectory started not at the muzzle, but in the direction of the last call to the trajectory. As shown in the figure: Later I thought that it might be because TrailRenderer did not clear the object data when it was recycled into the object pool. Then I added "instance.Clear();" to the PlayTrail method code in the GunScriptableObject class to solve the problem. The code is as follows (add code in the commented part):
I want to know why you can still make the bullet trails not appear broken without clearing the TrailRenderer data。 I'm sorry for my poor English,Thanks for your tutorial,love from china.