- Home /
Rotatearound Collider axis
I'm looking for in the long run is essentially a sort of "hinge" effect using rotate around. When the player looks at a wall & presses a button the world around the player rotates 90 degrees using:
the player as the point
&
*the specific walls forward/backward or up/down axis (depending on whatever wall the player is directly looking at)
I want to use a ray that is being cast from the player to determine which walls axes will be used by my rotation script since I have a fairly large number of walls, but I don't know how to do this.
Can you try and make it a bit clearer? Break it down. It will help to understand what you want better... Do you want to rotate the first person controller around the object? Do you need it to move around the hit object? Or just face it? Do you want the first person controller's local rotation to change based on what the ray hit?...
Answer by synapsemassage · Apr 26, 2011 at 12:48 PM
The easiest thing I can think of is to make the collider object (dummy), that is hit by the ray cast, a parent of your first person. Then rotate the dummy. Your first person will rotate properly (follow) because it's a child of your dummy. When rotation ended you can unparent again if needed. Repeat this as needed on other dummies. Hint: You might want to reset the dummie's rotation to avoid rotation mess if dummy is hit another time by ray cast starting the procedure another time.
I attempted to clarify my question since this doesn't seem to be what I'm looking for.