Issues with Camera Center


#1

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!


#2

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


#3

Check the layer you are describing,

Or

Create a variable for the x position of camera


#4

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


#5

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


#6

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.