This question was
closed Nov 14, 2016 at 02:31 PM by
Landern.
Question by
$$anonymous$$ · Nov 14, 2016 at 02:24 PM ·
raycastfpsbullethole
Assets/Scripts/BulletScript.js(8,28): BCE0023: No appropriate version of 'UnityEngine.Physics.Raycast' for the argument list '(UnityEngine.GameObject, UnityEngine.Vector3, System.Object, UnityEngine.RaycastHit, float)' was found.
Hello :D
I am a beginner in programming so my skills are not very good...
I am trying to make a first person shooter for a school project and I'm trying to add in bullet holes but I've come across this error and I have no idea on how to solve it...
Assets/Scripts/BulletScript.js(8,28): BCE0023: No appropriate version of 'UnityEngine.Physics.Raycast' for the argument list '(UnityEngine.GameObject, UnityEngine.Vector3, System.Object, UnityEngine.RaycastHit, float)' was found.
Here is the script:
var maxDist : float = 1000000000;
var decalHitWall : GameObject;
var floatInFrontOfWall : float = 0.00001;
function Update ()
{
var hit : RaycastHit;
if (Physics.Raycast(decalHitWall, transform.position, transform.foward, hit, maxDist))
{
if (decalHitWall && hit.transform.tag == "Level Parts")
Instantiate(decalHitWall, hit.point + (hit.normal * floatInFrontOfWall), Quaternion.LookRotation(hit.normal));
}
}
Thank you in advance :)
Comment
Follow this Question
Related Questions
Disable Damage Raycast? 1 Answer
Raycast Weapon not cause damage 1 Answer
Raycast to multiple objects 2 Answers