playMaker

Author Topic: Grid Movement ( Like Frogger 2 /Crossy road)  (Read 3800 times)

necrio2

  • Playmaker Newbie
  • *
  • Posts: 15
Grid Movement ( Like Frogger 2 /Crossy road)
« 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?

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #1 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.
Available for Playmaker work

necrio2

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #2 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

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #3 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?
Available for Playmaker work

necrio2

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #4 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.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #5 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.
Available for Playmaker work

necrio2

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #6 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!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #7 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 :



necrio2

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #8 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!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Grid Movement ( Like Frogger 2 /Crossy road)
« Reply #9 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 :)