Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Seiryu33 on May 19, 2021, 04:01:31 AM

Title: Changing layers in top-down 2d
Post by: Seiryu33 on May 19, 2021, 04:01:31 AM
So this is one i've been trying to find information on. Specifically, for a top-down game, how would I program characters to jump from layer to layer? Like if the player character is on a ground layer and an enemy jumps down from above, how would I set that up?
Title: Re: Changing layers in top-down 2d
Post by: djaydino on May 19, 2021, 07:53:35 AM
Hi.
which part you have difficulties with?
Detecting player
Jump down?

to detect you can do for example a box cast(2D) (Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181))

To jump down you could disable the collider for a moment to pass thru the floor.
Title: Re: Changing layers in top-down 2d
Post by: Seiryu33 on May 19, 2021, 06:58:43 PM
Like in Phantom Hourglass/Spirit Tracks where you can move from layer to layer: I.e, walking down staircases, being boosted up to another layer by wind gusts, etc. Like if I wanted to boost a character onto a layer above them.
Title: Re: Changing layers in top-down 2d
Post by: djaydino on May 20, 2021, 05:43:31 AM
Boost up you could use 'Add Force' or animate it with a Tween action

for stair cases use a flat surface as collider and rotate it to the degree your staircase is.
Title: Re: Changing layers in top-down 2d
Post by: Seiryu33 on May 20, 2021, 06:57:53 PM
To kind of expand on the topic, how would I make characters fall down holes? For top-down games, you would have to set gravity to 0, but would still be the same basic issue of changing layers.
Title: Re: Changing layers in top-down 2d
Post by: djaydino on May 20, 2021, 07:05:23 PM
Hi.
Why would you need to set the gravity to 0?

you can rotate the camera to make it look topdown.

Also you can set gravity to a certain direction. (i believe somewhere in the project settings)

both can work