- Home /
Need coding help with fps
I need help. I have a gun, and I want to make it so that when the player presses the left mouse button, it shoots a ray from the player in the direction the camera is facing, and if the ray hits an object with the "Shootable" tag, it creates a bullethole object (a small plane with a bullethole material on it) on the surface of the object it hit. I am really new to javascript, so I need the code that would do what I need, the tag being "Shootable".
The code needs to:
Shoot a ray from the camera in the direction the camera/player is facing create a bullethole object on the surface of what the ray hit
When the mouse button, or "Fire1" is pressed.
This doesn't only sounds like you ask for others doing your work, you actually did...
Besides that that question has been asked countless times here, so i guess you did not search before you posted this question.
Even most tutorials contains such scripts.
yup. Start with the Boot Camp tutorial, that should answer all your questions
Your answer
Follow this Question
Related Questions
How can I make a gun shoot raycast by rounds per minute(RPM)? Making a FPS controller and need help! 0 Answers
crosshair scrip not working 1 Answer
Do raycasts only collide with colliders or can I detect a hit through something else? 2 Answers
Using raycast gun to take down life of enemy when shot 1 Answer