- Home /
Why are these scripts not working?
Hi! So I am making an FPS and I am watching a "Make an FPS" tutorial by Jimmy Vegas on YouTube. I wrote the script for a Raycast and an Enemy damage. When I am on monodev, and I right-click then press "run to cursor" (that is how I debug the script) the debug comes out clean. When I try to attach the scripts to theire places (enemy on a cube, raycast script on my gun), they say they are incorrect. Please help!
Here are the scripts:
"they say they are incorrect" is not a useful problem description. What says what is incorrect? If you get an error message, paste it here - error messages are there to help you.
Answer by Cornelis-de-Jager · Jul 12, 2017 at 12:10 AM
I think the fault is in your Raycast Funciton. see the out function.:
if (Physics.Raycast (position, direction, out shot)) {...}
Thank you! I will try that. But what about the enemy damage script not working (not attaching to the enemy)? Or will the out function fix that?
Your answer

Follow this Question
Related Questions
how to make a detect rotation script for negative rotation too 2 Answers
WaitForSeconds() and WaitForSecondsRealtime() negative number concern!!!! 4 Answers
[HELP] How to smoothly rotate camera 180 degrees on key enter? 1 Answer
SimpleMove not working on Y axis? 1 Answer
Custom UnityEvent in Editor Window 1 Answer