x


How "include" the Raycast?!

I'm learning Unity and I got this error...

Assets/RaycastHit.js(7,27): BCE0023: No appropriate version of 'UnityEngine.Physics.Raycast' for the argument list '(UnityEngine.Vector3, UnityEngine.Vector3, RaycastHit, int)' was found.

What I need to do to use the raycast!?

All the best!

more ▼

asked Apr 25, 2011 at 07:19 PM

Alexandre gravatar image

Alexandre
5 6 4 8

Can we see the code you are using?

Apr 25, 2011 at 07:22 PM oliver-jones
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

looks like you named your class RaycastHit which overrides the RaycastHit class in Unity. Physics.Raycast() doesn't know what to do with your class so it errors out. Rename your class as something else or use UnityEngine.RaycastHit when declaring your variable.

more ▼

answered Apr 25, 2011 at 07:22 PM

Ben Holmes gravatar image

Ben Holmes
328 7 7 17

It's works! Thanks! :D

Apr 25, 2011 at 07:32 PM Alexandre

just forgot, the problem was the class name...

Apr 25, 2011 at 07:39 PM Alexandre
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3761
x210
x46

asked: Apr 25, 2011 at 07:19 PM

Seen: 1913 times

Last Updated: Apr 25, 2011 at 07:19 PM