Camera shaking and parent movement

Hi!

I 'm having an issue with iTween and shake camera with ShakePosition function.

The structure is a gameObject with a rigidbody component, and a child with the main camera.

I move the camera adding a force to rigidbody of the parent object, and I shake the camera using iTween.ShakePosition on itself.

My problem is when I shake the camera, the parent (rigidbody) is stopped, and resume the movement when the shake of the camera ends.

The strange part is if I use another function such as iTween.PunchPosition instead iTween.ShakePosition, it works properly.

Any helps?
Thanks in advance!
Pablo.

methinks iTween (don’t know what is this) stores camera’s position before shaking effect and then applies new position some times a frame using

NewCameraPosition = StoredCameraPosition + RandomOffset

so moving is overrided and every time position is set to it’s stored value.

what can you do?

solution

add little improvements to script that stores and changes localPosition of camera instead of position. localPosition is relative-to-parent position and can be changed by iTween safely for shake effect while parent with rigidbody moves.

if you stuck in it, post a source of

iTween.ShakePosition(...

method, we will help 8)