- Home /
Avert Fate Style FPS Gun Script
I am looking for this code a for long time now but still no success! I wanted to make an Avert Fate Style gun that move slightly damper than the mouse. When you move the mouse the camera and gun's rotation timing are different from each other the gun moves to the position slightly slower than the Camera.
May You can help me out!
Answer by Justin Warner · Dec 05, 2010 at 03:08 AM
Make the gun rotate indpendent of the camera, and have it rotate the same way as the camera though, but move slower.
100 in this is the speed to rotate...
var targetRotation = Quaternion.LookRotation(target.position - transform.position, Vector3.up);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 100);
I wonder if this could help you, maybe something with a raycast (Think cross hair from the camera to shoot in the middle too) from the camera, and make the targetRotation equal to that of the camera...
Good luck, hope this gave you an idea at the least!
Your answer
Follow this Question
Related Questions
FPS Aim Down Sights. Exact Position. 1 Answer
FPS Advance Gun Script 1 Answer
Fps Controller fixed object (Gun) (Solved) 1 Answer
Aiming down a gun 4 Answers
Weapon random movement 0 Answers