- Home /
Sometimes one sometimes two clone is formed. I just want to form a clone
I have a bool variable that activates with the animation. It shoots arrows depending on whether it is true or false, but sometimes it shoots 1 sometimes 2 arrows. How can I fix this.
Fire()
is being triggered twice on your update.
Also look into event's the way you're doing it isn't the best way to handle this logic.
Answer by VioletAbstract · Mar 03 at 11:17 PM
Inside the if statement, right before you instantiate the clone object, set the arrow bool to false. This will prevent the code from running again on the next frame which is probably causing the second clone to spawn.
Your answer
Follow this Question
Related Questions
Making a Clone a Child of Another Object 1 Answer
How to let clone reborn? 0 Answers
Unique names for Instantiated prefabs? 1 Answer
How to have different textures for cloned gameobject (instantiated) 1 Answer
Infinite Road Clone Duplication 1 Answer