playMaker

Author Topic: Drag Rigid Body  (Read 3318 times)

disaldo

  • Playmaker Newbie
  • *
  • Posts: 2
Drag Rigid Body
« on: May 30, 2011, 09:47:51 AM »
Hi I am trying to lay down a  set of rigid bodies by dragging an object then selecting another object and placing it and so on until I have a wall of objects.  The aim is to demonstrate to student bricklayers the building process.  I am trying to do this using Playmaker and the MouseClickToDrag and the MouseClickToPlace FSM's with no success.  No matter how many objects I use and add the FSM to them individually it still only moves one object (the original) whilst leaving the rest non movable.  Can anybody point me in the right direction to getting this done in Playmaker or would it be best to stick with script using DragRigidBody.

Thanks in advance

Ste

LordShaggy

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 50
Re: Drag Rigid Body
« Reply #1 on: May 31, 2011, 12:09:32 AM »
I dunno of this "MouseClickToDrag" and "MouseClickToPlace"  It's really hard to decern where the issue is.

It sounds like, correct me if I am wrong.  You want to be able to click on a brick. Move it to another location, release it, and it place and you want there to be a rigid body on it.

I wish you would tell me how you are doing it but let me tell you how I do it.

-create a game object in your scene and call int Input
-Create an FSM on this object that uses the Mouse pick action.
-Store the item that the mouse clicks on and validate that item however you want
-Then use Move towards and attach it to your mouse.  There are a few ways to do this... the way I do it is when you have the object picked up, you call a mouse pick every frame and set the move to the postion of the pick.
-that should have the object tracking your mouse.
-Then you just need another action that will cause the person to release the block.
That should do it more or less.

I would try to handle all the controlling of grabbing it and releasing in one FSM.   
Something else to help, try to minimize how many actions you put inside of a state.  So far we have found it's better to split up your states into as many little chunks as you can to make it easier to debug.  So treat a state like one thing you want to do there.

I actually have an example doing exactly what your talking about, so I know it works. I just can't post it sadly at the moment.  I will post a tutorial on my site on how to get things tracking to the mouse.

disaldo

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Drag Rigid Body
« Reply #2 on: May 31, 2011, 06:08:17 AM »
Hi Thanks for the quick response.  The MouseClickToDrag and MouseClickToPlace are in the Playmaker samples.  I am currently using just script to roughly achieve what I want, but I am determined to make more use of Playmaker-hence the question.  I work at a College and one of the Bricklaying tutors wants to integrate more IT into the learning environment I suggested using games to engage the kids with.  He basically wants something where as you correctly identified the user clicks on a brick and moves it to a location, releases it and places another next to until they have a wall.  I shall try your method tonight. 

Thanks again for this guidance.  Is your web site http://www.digitalwarlords.com/ if so also thanks for the videos on your site most useful. 

Regards

Ste

LordShaggy

  • 1.2 Beta
  • Junior Playmaker
  • *
  • Posts: 50
Re: Drag Rigid Body
« Reply #3 on: May 31, 2011, 05:27:04 PM »
Yes, I and LordShaggy are one in the same.  That is, He is me and I am him. =)

Send me a message on here. If you keep having issues, I will whip up a quick scene for you.  I can't promise the speed in which, but it would be sooner than later.
« Last Edit: May 31, 2011, 05:30:59 PM by LordShaggy »