Issues with Camera Center

Hi,

I am trying to center the camera on an object if it double-clicked. I got it to work using variables but run into an issue when there are multiple instances of one object. This is what I have currently.

I tried using an id variable for each of the object instances but am doing something wrong since it is still not working.

Any help you can give would be appreciated. Thanks!

Add a loop “for each” add the object to your loop and all your events on screenshot move it as subevent of the loop.

Check the layer you are describing,

Or

Create a variable for the x position of camera

Thanks for your response! I tried this but it still isn’t working. Did I do it wrong?

Thanks for responding. Could you possibly go into a little more depth about adding a variable for camera’s x position?

In your screenshot, you’re doing 2 conflicting things

Center camera on MediumBed
Do +60 to X position of Camera

You cannot center the camera on the Medium bed at the same as an event to take the current Camera Position and add +60 X, as the system will likely try to fight over which event takes precedence.

You can, however, merge the two. Try:

Do = (MediumBed.PointX(“center”) + 60) to X position of camera
Do = (MediumBed.PointY(“center”)) to Y position of camera

Remove the Center camera on MediumBed event.

See if that works.