- Home /
Question by
DayyanSisson · Oct 22, 2011 at 11:28 PM ·
transformtransform.positionattackmeleetransform.forward
Bayonet Action Transform
On my weapon, there's a bayonet attached, and I want a simple thrust of the gun so for the bayonet to injure the enemy. I could always do an animation, but I would rather do it in code, by transforming it's position forward a little bit, and when the mouse button is released, the position set back to the way it was. Is this possible? If so, how should I implement this?
Comment
Your answer
Follow this Question
Related Questions
My object is translating with speed but does not stop... 1 Answer
Need help making player invincible momentarily 2 Answers
Getting the transform from a GameObject list 3 Answers
Confuse about transform.InverseTransformPoint 1 Answer
Possible way to improve performance moving large hierarchies? 1 Answer