Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: necrio2 on April 11, 2018, 08:50:18 PM

Title: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: necrio2 on April 11, 2018, 08:50:18 PM
Hello,

I am trying to learn grid movement. Similiar to frogger 1/2. Where the player moves one tile at a time.

I have googled and search through these forums and youtube, but cannot find and a good enough solution.

So, when I have simple grid movement ( Move to/ iTween move to/Move by..move towards/move towards advanced) I have no collision. Tried Rigidbody/colliders on/off everything.


My question is how to do grid movement But still have collisions?
Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: Fat Pug Studio on April 12, 2018, 03:02:38 AM
What is the problem with colisions? If you're having a rigidbody and colliders, any collision should be detected, unless the movement is too fast, collider is too small, or your movement is actually just setting position instead of moving the transform from one point to another.

I can post you a small example when i get to desktop.
Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: necrio2 on April 12, 2018, 05:13:18 AM
Here is a GIF of the 'no collision'

Plus the movement I am using currently.

https://imgur.com/a/p8WXn
Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: Fat Pug Studio on April 12, 2018, 06:08:22 AM
Is there a collider on the player? Rigidbody? Rigidbody typer set to appropriate types? Collision matrix set for the layers to collide?
Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: necrio2 on April 12, 2018, 06:41:23 AM
I have set it
Player and Box
Rigidbody   / box collider  on and off ( to test )

 In addition, I've tried kinematic and gravity on and off.

changed tags to player / enemy.

not sure what else to try.
Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: Fat Pug Studio on April 12, 2018, 09:13:32 AM
Try out setting them both to kinematic, simulated and full kinematic contacts checked, continuous collision detection, start awake.
Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: necrio2 on April 13, 2018, 05:40:11 AM
Actually tried that. Didn't work.

Played with settings all night.

The only thing that worked right was the get vec axis / controller move. That had the movement plus the collision. But it wasn't the 'grid' movement I wanted.

I was reading some stuff and thinking of using arraymaker, making an array grid and movement through that.

However, I don't know how I'd do that yet. Does anyone have a way to make a grid movement with arrays?

Thanks!
Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: djaydino on April 13, 2018, 11:43:34 AM
Hi,
I made you a sample prefab that you can try out in the attachment.

and a video with some explanation but not with arrays :


Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: necrio2 on April 13, 2018, 06:14:13 PM
Thanks a ton, Diaydino.

Definitely helped solve the problem. I was working with raycast and getting somewhere. However, you fixed the missing piece.

I am gonna play with this a bit, set it up, and make a tutorial so you ( or another admin ) can post it to the tutorials. This can be useful, but enough out there to help with this subject!
Title: Re: Grid Movement ( Like Frogger 2 /Crossy road)
Post by: djaydino on April 13, 2018, 08:23:55 PM
Hi.
I am happy it helped :)

I am actually planning to make a tutorial on this also, but i am still playing around with some other movement styles :)