How do I switch the camera between objects?

0 favourites
  • 6 posts
From the Asset Store
Simple and easily editable template for a dynamic camera that zooms in and out based on how far apart the players are.
  • In my game, when <font color=blue>ObjectA</font> collides with <font color=red>ObjectB</font>, <font color=blue>ObjectA</font> spawns <font color=purple>ObjectC</font> & then dies. It's ike a shard broke off the original object & kept going.

    Is there an event I can set up so that the game's "camera" scrolls to <font color=blue>ObjectA</font> until the collision, & then switches to scrolling to <font color=purple>ObjectC</font>? I've tried just adding the "scroll to" behavior to both the objects, but it slows down the game. When I tried it with THREE objects, the results quickly turn unpredictable.

    thanks in advance..... I came here after trying Stencyl. In 2 days I've gotten as far with Construct2 as I did in 2 weeks with Stencyl.

  • Off the top of my head:

    Create a small, transparent object (CameraProxy) and pin it to ObjectA. Then, when you collide with ObjectB, destroy ObjA, spawn ObjC, move CameraProxy to ObjC's origin point and pin it to ObjC.

    Cheers,T

  • TiAm's suggestion is good.

    Another way would be to have the Scroll To behavior for ObjectA enabled, and disabled for ObjectC.

    When the collision happens, disable it for ObjectA and enable it for ObjectC.

  • Yet another way would be to use the system scrollto action instead of scrollto behaviour.

    It can give you far greater control over the scrollto.

    it would be as simple as creating a variable and adjusting it.

    if variable is A - system scrollto objectA

    if variable is C - system scrollto objectC

  • thanks for all the advice....I'm gonna go try out these methods & see how it goes

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • there was a lot of trial & error (more error than trial), & I ended up going with the "Set ScrollTo enabled" method. I initially didn't see the option....but yeah...it's exactly what I needed. Thanks again. I'm sure I'll be back with more noob questions soon.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)