playMaker

Author Topic: Object collide with mouse controller [Help]  (Read 2004 times)

Jontiways

  • Playmaker Newbie
  • *
  • Posts: 4
Object collide with mouse controller [Help]
« on: September 18, 2013, 11:50:27 AM »
I am currently am having some trouble making an object which is controlled by the mouse so when it collides with another objects, it will not pass through it.
Does anyone know how to do this, or can point me in the right direction? I know this may come across a little newbish and all, as I am new to this. I hope the picture below might help explain what I am trying to do too.


[img=http://s23.postimg.org/m8rdbr3jb/help1.jpg]

Jontiways

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Object collide with mouse controller [Help]
« Reply #1 on: September 19, 2013, 09:50:29 AM »
Hate to double post here, but does anyone have an idea for this? I am stuck with this problem and I need some way to solve it?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Object collide with mouse controller [Help]
« Reply #2 on: September 19, 2013, 10:00:53 AM »
I did this once by using the A* pathfinding kit here and making the target object follow the mouse that skates across the floor, at a speed high enough to look instant while using rigidbodies to handle collisions and stop the box when it hit something despite the mouse target being inside that object.

Without using physics I'm not sure. You could also get the angle between the target and the object, then apply force on that angle but it would require a lot of tweaking it make it work.

That's the only ideas I really have.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4002
  • Official Playmaker Support
    • LinkedIn
Re: Object collide with mouse controller [Help]
« Reply #3 on: September 19, 2013, 04:56:40 PM »
You could add a RigidBody to the controlled object and a box collider to the wall. Make sure to set the RigidBody to IsKinematic since you'll be setting its position explicitly.

But it might be easier to use Unity's character controller.

There's an example in the Playmaker Samples:
PlaymakerSamples\TestLab\Character\ControllerSimpleMove