x


Cube Movement with Raycast

Hello Everybody,

I need a litle help from you... I have a two object in my scene as named Cube1 and Cube. I want Cube1 go to Cube automaticly with raycast.

How can i make that?

Regards Vincenzo

more ▼

asked Jul 17 '10 at 10:47 PM

Vincenzo Albery gravatar image

Vincenzo Albery
49 20 24 34

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Here are the basics of moving a game object to another game objects position No RayCast in that example as it isn't required, but here are some pointers on using RayCast

more ▼

answered Jul 17 '10 at 11:14 PM

Julian Glenn gravatar image

Julian Glenn
2.6k 5 12 47

I tried this No RayCast sample but i take this error

UnassignedReferenceException: The variable Cube1 of 'NewBehaviourScript 2' has not been assigned. This happened in the game object "GameObject". You probably need to select the "GameObject" in the hierarchy and assign the Cube1 variable of the NewBehaviourScript 2 script in the inspector.

NewBehaviourScript 2.Update () (at AssetsNewBehaviourScript 2.js:8)

Jul 17 '10 at 11:44 PM Vincenzo Albery

Take few days. Read the UNITY documentation. Work with the tutorials. At least get the basics down.

Jul 17 '10 at 11:51 PM Julian Glenn

UnassignedReferenceException basically means that Unity went to get a variable and it wasn't there. In the inspector window, drag your cubes to the designated location. Then, please, take a day or two, just to learn the basics of Unity. It isn't meant to be that hard, but I know it can be intimidating for a newcomer. And remember, we are always here to help :)

Jul 18 '10 at 12:34 AM Peter G
(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:

x1579
x297
x266

asked: Jul 17 '10 at 10:47 PM

Seen: 1507 times

Last Updated: Jul 17 '10 at 10:47 PM