#in the script associated with the camera

1 messages · Page 1 of 1 (latest)

fluid notch
#

I dont think thats going to do anything did you try getting the opposite quaternion?

glossy cape
#

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

fluid notch
#

Yes that would be great

glossy cape
fluid notch
#

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?

glossy cape
#

yes now I send you the pastebin

yes the rotation of the camera at the beginning of the game is 0

fluid notch
#

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

glossy cape
#

it's the same, only that I had the hierarchy open

fluid notch
#

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

glossy cape
#

it still turns around

fluid notch
#

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

glossy cape
#

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?

fluid notch
#

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