- Home /
Rotating a skybox with mouse look.
I'm looking for a method to rotate the skybox along the x or z axis that also takes into consideration the mouse look component.
I've tried the second camera technique and I can get the skybox to match the main camera's view, but I can't seem to figureout how to add in a constant rotation around the x or z axis. The techniques I've tried have resulted in a uniform rotation regardless of what direction the camera is pointed.
rotationValue = new Vector3(WorldMapCamera.transform.rotation.eulerAngles.x + turnVal, WorldMapCamera.transform.rotation.eulerAngles.y, WorldMapCamera.transform.rotation.eulerAngles.z);
The problem I'm having is that the skybox is always rotating in the same direction regardless of what direction the main camera is looking (via a mouse look script).
To be more specific, I'm trying to rotate the skybox around a space station. I don't want to spin the space station since it contains a terrain (which from what I've read can't be rotated. )
Answer by N00MKRAD · Sep 13, 2017 at 07:52 AM
Why does it need to be synced with the mouse look??
Just do something like this in Update():
skyboxGO.transform.rotate(0.5f);
Answer by dalekvan · Aug 18, 2020 at 03:13 PM
I was able to "rotate" the skybox (perceptively anyway) by creating a new top-level Game Object and putting everything else inside it, including the camera, then rotating this the opposite way that you want your skybox to appear to move.
Your answer
![](https://koobas.hobune.stream/wayback/20220612134612im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Strange hang on load with skybox. 2 Answers
how to use 360 images to make it feel like player is on floor. 1 Answer
Alpha:fade shader and Skybox? 1 Answer
How i can make a shop for skybox/background? 2 Answers
How to create a spherical skybox??? 1 Answer