playMaker

Author Topic: Collision  (Read 2023 times)

CreepyCritter

  • Playmaker Newbie
  • *
  • Posts: 2
Collision
« on: September 26, 2014, 11:12:15 AM »
Hi,

I just recently purchased Playmaker to try and make a simple game or two. I don't know how to write code so this is perfect for me. It is working really well for me and I have made great progress with it even in a couple of days.

But my problem is that I can make colliders work. It is probably something simple that I am doing wrong. I have made game character that you can control with a mouse like in the tutorial about Mouse pick.

What would be the smartest way to make the character just stop if you try to run him through a wall or something? I managed to make him stop once if he touches the collider by resetting the target object to his current location, but then you can just cllick again past the wall and he continues through.

So I think there are probably a better way to make him stop moving and prevent moving through those walls but I cant think any way to make it happen. Any help you guys can give me would be really good.

TrentSterling

  • Junior Playmaker
  • **
  • Posts: 89
  • Someday I'll make games!
    • My Blog
Re: Collision
« Reply #1 on: September 26, 2014, 02:37:23 PM »
My advice would be to use the physics system to your advantage. Assign a rigidbody to your player character, so that if he runs into a wall, the physics system pushes him out. Good luck.  ;)

CreepyCritter

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Collision
« Reply #2 on: October 07, 2014, 02:00:05 PM »
Yeah I actually had rigidbody on him, but I guess that I just messed up somewhere. I managed to fix my problem by making raycast and stopping if distance was too short. Maybe not the best way to do it, but at least I learned something.

ivam

  • Playmaker Newbie
  • *
  • Posts: 34
Re: Collision
« Reply #3 on: October 09, 2014, 02:43:51 PM »
your character needs a collider and your wall needs a collider only colliders can collide wiht each other obviously so collider vs mesh will still go through the mesh. Additionaly rigidbody on player to enable physics and gravity.

hope that helps!