- Home /
3D Spawn a weapon at player and swing with it once.
Hi, I am trying to create a character that will automatically spawn a blade and swing with it when an enemy comes close.
Basically, when a gameobject with the tag enemy enters the player's sphere collider, an object (lets just say the object is a cylinder rescaled to look like a pole or something) will appear near the player character, which will swing and damage any enemy it hits.
the blade has to swing around where the enemy is (so its not a full rotation around the player), which will knock them back slightly and damage them. the blade then disappears after a small margin of time, and then gets set on cooldown, so it cannot spawn multiple times at the same instance, and it cannot be spammed.
things to note: the game is in 3D, and it's top down view, so the y is unneccesary to calculate at any given point.
Thanks in advance!
Your answer
![](https://koobas.hobune.stream/wayback/20220612033346im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Two Objects Touching? 0 Answers
Level spawning statement help 0 Answers
Spawner continuing after boss dies 1 Answer
I can't get Destroy(collision.gameObject) to work? 2 Answers
Help moving turret shoot lasers 2 Answers