How do I switch the camera between objects?

Get help using Construct 2

Post » Sun Jan 19, 2014 12:49 am

In my game, when ObjectA collides with ObjectB, ObjectA spawns ObjectC & 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 ObjectA until the collision, & then switches to scrolling to ObjectC? 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.miketv2014-01-19 01:40:41
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Sun Jan 19, 2014 3:13 am

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
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sun Jan 19, 2014 7:18 am

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.
B
99
S
35
G
20
Posts: 438
Reputation: 17,910

Post » Sun Jan 19, 2014 4:39 pm

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
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 21, 2014 4:53 pm

thanks for all the advice....I'm gonna go try out these methods & see how it goes
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450

Post » Tue Jan 21, 2014 11:01 pm

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.
Phase 1: Collect Underpants.
Phase 2: ????
Phase 3: Profit!
B
16
S
5
G
4
Posts: 106
Reputation: 2,450


Return to How do I....?

Who is online

Users browsing this forum: WesleyDeveloper9 and 7 guests