- Home /
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
Answer by Julian-Glenn · Jul 17, 2010 at 11:14 PM
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
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 Assets\NewBehaviourScript 2.js:8)
Take few days. Read the UNITY documentation. Work with the tutorials. At least get the basics down.
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 :)
Your answer
Follow this Question
Related Questions
Player won't move to a certain location clicked by the mouse 0 Answers
Raycast only hits the layer when hitting top of cube 3 Answers
Detect if object is a cube(find the primitive type) with physics.raycast 2 Answers
AI Player Jerky Movement - Overcoming Obstacle 0 Answers
help with AI avoidance script 0 Answers