- Home /
Shake and move at the same time
Hi guys, i have a problem in my project. I'm trying to shake the camera that follow the player. The problem is: when the camera shake, she stops following the player.
I already tried itween and is not possible.
Any clue?
Without any code it's hard to guess where the problem might lie so try posting the "shake" code at last. If I had to guess then you'r probably adjusting the position coordinates while shaking it which would explain why it stops moving.
I'm using this script on my camera with little changes but is basicly this code.
Well, it does seem to adjust the position and rotation of the camera so I was probably right and the script is setting the cameras position while ignoring your movement. I guess that you might want to modify the "originPosition" variable to get the script working with a moving camera or perhaps just try to adjust the "originPosition" variable manually (I mean setting the Vector3 to the position where you want the camera to be at or to move to)
You are completly right, i just needed to put, the instruction originPosition = cameraObject.transform.position; in function Update.
many thanks