#in the script associated with the camera
1 messages · Page 1 of 1 (latest)
I dont think thats going to do anything did you try getting the opposite quaternion?
yes, but the flashlight in this case turns in the wrong direction of the camera
since you created this thread, I can make you a clip maybe, if you want to get a better idea of what's going on
Yes that would be great
tell me if you understand what happened
Could you post your flashlight code again?
And are there any rotations within the hierarchy in the flash light prefab
also at the start of the game - is the local rotation of the camera (in the player object) 0?
yes now I send you the pastebin
yes the rotation of the camera at the beginning of the game is 0
your hierarchy looks different from the screenshot you posted earlier, could you try wrapping the flashlight object in another gameobject, add a 180 rotation to the object now called "flashlight" and then a 90 rotation + the flashlight follow script to the newly created gameobject
https://pastebin.com/vfMkat3G script camera
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
it's the same, only that I had the hierarchy open
okay so remove the current flashlight script from the flashlight prefab,
Add a new gameobject with the flashlight script
parent the flash light under that newly created gameobject, and rotate the prefab 180 degrees on the Y axis
it still turns around
Could you take a screenshot of the hierarchy + inspector on the newly created gameobject and the flashlight rpefab?
So two screenshots
Going to head to bed in a hot minute here
one moment
maybe you're right, I forgot to set the child to 0
Perfect! it seems to work!
was the problem really the flashlight object?
Yes
I've had this happen a lot of times
Where our modeller would export the model in the +z direction when it should be -z or vice versa
And then it doesn't make sense with the rest of your game
So your model was probably in the wrong direction, you build your prefab around that
And suddenly it's pointing the wrong direction
So you could also rotate every component in your prefab with 180 degrees, move the script back to the prefab
And remove the parent gameobject
And you'd have the same result
Happy I could help though! Have a good one