- Home /
teleport an object in space
Hello,
I have made a game so far, and now I want to instantiate a sphere. if that sphere collides with a object, it needs to teleport to the location of the object i want. (The object can rotate). Here is a screenshot:
that blue sphere can collide with those yellow buttons on the cubes. For example, if it collides with the green cube, then it will come out of the other green cube. How can i make that it uses a * force into the right direction? Does anyone have a example script or ideas?
Thank you for the help.
Answer by hav_ngs_ru · Dec 08, 2014 at 05:05 PM
i guess you dont need a force, just change transform.position
what exactly do you mean with 'change transform.position'?
@Artomix he means player.transform.position = target.transform.position;
Answer by leonardherndon · Dec 08, 2014 at 08:53 PM
You'll want to change the position of the sphere's transform.
Sphere.transform.position = otherGameObject.transform.position;
That's just the position movement. But you'll need to put that in your collision detection method.
Your answer
Follow this Question
Related Questions
Building with cubes in Unity,Building meshes out of cubes 0 Answers
3D Cube Face Detection 1 Answer
How can I compute the intersection between two cubes? 0 Answers
Cubes are showing outlines 1 Answer