playMaker

Author Topic: Dropping items in playmaker.  (Read 7316 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Dropping items in playmaker.
« on: March 10, 2014, 01:24:24 AM »
How do I set up a game object to generate items to drop down with only playmaker?

Thanks.




Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dropping items in playmaker.
« Reply #1 on: March 10, 2014, 07:50:43 AM »
Whats making it stay in place/attached?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Dropping items in playmaker.
« Reply #2 on: March 10, 2014, 03:44:36 PM »
Whats making it stay in place/attached?

I forgot to remove the block and it's fsm. I want the object above it to drop objects that it generates. 
« Last Edit: March 10, 2014, 03:54:46 PM by coffeeANDsoda »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dropping items in playmaker.
« Reply #3 on: March 10, 2014, 03:46:31 PM »
You can add a Rigidbody to it and turn Gravity on.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Dropping items in playmaker.
« Reply #4 on: March 10, 2014, 03:53:25 PM »
How would that work for having objects appear? Like a crane just dropping objects?
« Last Edit: March 10, 2014, 03:54:56 PM by coffeeANDsoda »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dropping items in playmaker.
« Reply #5 on: March 10, 2014, 04:02:35 PM »
Setting up a physics based crane is no simple task, but one easy way to sort of do it is... you can disable the rigidbody, parent the box to the crane and when you want to drop it just unparent it and turn on the rigidbody, gravity will take over.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Dropping items in playmaker.
« Reply #6 on: March 10, 2014, 04:20:50 PM »
And that way, it drops a single object in the whole game, or does it drop another after the player catches it? Because I thought about making a stacking game where player has to catch objects.   
« Last Edit: March 10, 2014, 04:33:55 PM by coffeeANDsoda »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dropping items in playmaker.
« Reply #7 on: March 10, 2014, 05:45:33 PM »
It does whatever you tell it, if you tell a Rigidbody to use gravity then it will fall down.

If you're using physics and stacking, it'll be worthwhile to look into the physics joints.

https://docs.unity3d.com/Documentation/Components/comp-DynamicsGroup.html
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Dropping items in playmaker.
« Reply #8 on: March 11, 2014, 02:13:30 AM »
Setting up a physics based crane is no simple task, but one easy way to sort of do it is... you can disable the rigidbody, parent the box to the crane and when you want to drop it just unparent it and turn on the rigidbody, gravity will take over.

What does that mean for actions? When I Add force and create object to drop, not only it drops down at a lower position than the spawn point, but another object doesn't drop down. I want to set up so another responds when the player catches it.

« Last Edit: March 11, 2014, 02:59:20 AM by coffeeANDsoda »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dropping items in playmaker.
« Reply #9 on: March 11, 2014, 07:20:35 AM »
All you have to do to make it fall with physics is add a Rigidbody Component and turn on gravity in the component. You shouldn't need Add Force down unless there is some reason you need to disable gravity. Which is fine, gravity is equivalent to roughly (9.81 * mass) if you wanted to do it explicitly in an action.

The hard part with doing it with physics is setting up the physics joints properly. Faking this with parenting and disabling rigidbody parts is easier than using the joints I think.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Dropping items in playmaker.
« Reply #10 on: March 11, 2014, 04:27:08 PM »
All you have to do to make it fall with physics is add a Rigidbody Component and turn on gravity in the component. You shouldn't need Add Force down unless there is some reason you need to disable gravity. Which is fine, gravity is equivalent to roughly (9.81 * mass) if you wanted to do it explicitly in an action.

Game object drops down realistically when I decreased the time of waiting in the first state. However theirs two problems. One being that they don't keep spawning in order to stack on top of the player. Second is, when the object falls on the player(which is a cube), it acts like it ricochets or bounces off of the player.

The hard part with doing it with physics is setting up the physics joints properly. Faking this with parenting and disabling rigidbody parts is easier than using the joints I think.

For now I have the crane set up so it doesn't have multiple objects representing parts of it like a real crane does. So it uses a itween action to go front to backwards.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dropping items in playmaker.
« Reply #11 on: March 11, 2014, 04:28:30 PM »
Can you take some screenshots of the FSMs you're having trouble with?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Dropping items in playmaker.
« Reply #12 on: March 11, 2014, 04:44:04 PM »
This is what I have for the crane.

https://db.tt/d2CwW48m



https://db.tt/FSKPLWR5

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Dropping items in playmaker.
« Reply #13 on: March 11, 2014, 05:24:02 PM »
Give this a try.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Dropping items in playmaker.
« Reply #14 on: March 20, 2014, 03:57:25 PM »
I took a look at the example and applied those actions. Doesn't work.

https://db.tt/AKduhYd3

https://db.tt/hFeGngQX