- Home /
Functions via camera rotations...
What is the simplest way to implement a function that is executed when the camera rotates to a specific point? Can this be done in a way, either than OnMouseEnter, like in horror games, where you look one way then back to find that something changed?
Please, I am not asking for a script, just the way I should structure it and how I would do it.
Thanks in advance!
Answer by darthbator · May 29, 2013 at 10:58 PM
What I do is cast a ray from the center of the camera out along it's local forward vector and then "monitor" it (you could also cast a line if you want a specific distance). I then place an invisible trigger where I want the look target to be and execute the method once the ray/line comes in contact with the trigger.
Thank you very much, your answer seems very logical too :)
Your answer
Follow this Question
Related Questions
Finding Edges 1 Answer
Camera in fixed position which rotates with player. 0 Answers
Logical Camera errors... 1 Answer