Line Renderer Help
I am trying to get this code to work
There is no bullet in the map at the start of the game
when the player shoots, a bullet prefab is spawned
i want a line to render from pos1 ( a set point ) to the spawned bullet and repeat everytime
3 Replies
So what issues are you having? Is there an error? What is expected vs what is happening?
have you stepped through the code to ensure BULLET is not null?
also is theline null?
If there is no bullet at the start of the game and the LinePositions script is attached at the start of the game, a game object with the tag Bullet will never be found
when in doubt try the vfx graph
not saying it'll work for this situation
but look it up, see if it fits
also all you really need to do is parent the linerenderer to the bullet prefab in editor
no scripting needed
no so the line is attached to the camera and exists
when the player shoots, the bullet prefab spawns
my aim is fo quite simply activate the line and attach it to the prefab when it spawns
u legend<3