- Home /
Plane on top of rotated cubes
Hi! If I have several in z roteted cubes with different x-sizes. The camera is in z-position -3 and will only change it's position in x and y. I want to add a plane (rotated 90 degrees in x and 180 degrees in z, so it faces the cam) on top of every cube, that the side of the cube just goes over into the plane. The plane has the same size in x as the cube and it should not be placed in the middle of the z-axis, it should just pass into the cubes side, that is next to the camera (that would be plane.transform.position.z - (cube.transform.localScale.z / 2)). How can I achieve that?
I'm fuzzy on the alignment you are trying to achieve, but I wanted to suggest one simplification. Ins$$anonymous$$d of using a built-in plane, use either the new, built-in Quad game object, or use a vertical plane created by the CreatePlane editor script. In both cases, the identity orientation (0,0,0) of the plane will have the visible face pointed towards the camera. This will make getting the rotation between the two object correct much easier.
Your answer
Follow this Question
Related Questions
How to Rotate Plane of Cube Around its Center? (Rotate Vectors Around Point/Axis/Direction) 1 Answer
Rotate an object such that it is theta degrees relative to another object 1 Answer
Rotate floor plane in-game via C# script 1 Answer
Create plane from 2 Vectors of a symmetry line segment 1 Answer
A small problem with rotating object at mouse position 1 Answer