So, I have this scene, which is bigger than a screen, and so when the character moves to the side the camera pans along to show the rest of the scene. Simple stuff.
Now I have an object on the far side of the scene, so that it is not visible to the player when the scene starts. What I want to do is to play a sound the instant the camera pans over this object and it appears on the screen.
Any ideas on how I can make this happen?
I have tried a solution using Action Areas, so that when the player walks close to this object the sound is played. But it is really tricky to get the camera and the walking character to sync up, and the sound if often played at the wrong time.
What I am really looking for is some what of measuring the cameras position, and not the characters position.
I found this lua thingy called:
which seems to be what I am looking for, but I have no idea how to turn that into an if-statement, or even if I can do if-statements that are checked on every update.
Does anyone have any ideas on what I can do to make this happen?
Thank you very much