- Home /
how do i make a proper mounted Machine gun
I have no idea how to even start this, but I'm trying to get a restricted moving machine gun. similar to the ones in the call of duty series that are already positioned.
Answer by Pecek · Oct 13, 2013 at 07:43 AM
It's just the same as any other "weapon", only thing it can't be moved. So, make a script for shooting, rotating, anything you want, and then make it "useable" by the player(for example, if the player is in range, and if the "use" button had been pressed, place the camera behind the gun(or switch to the gun's camera if you prefer that), deactivate the player, and activate the gun's scripts. After pressing the use button again, reverse the process.)
to extend on this, the two most simplistic ways I have done this are using a ray-cast or collision box (with isTrigger checked) to test if the player is behind the object so as to not mount from the front. But Pecek has covered it pretty well
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
bullets wont show up 1 Answer
Problem doing a script. 2 Answers
Script suddenly stopped working properly 1 Answer
Bullet Hole not inline with sight?(Center of Screen) 1 Answer