playMaker

Author Topic: Drag and Drop  (Read 1790 times)

jasperPT

  • Full Member
  • ***
  • Posts: 115
  • I am a VFX Animator teaching myself to make games
Drag and Drop
« on: May 28, 2013, 05:21:03 PM »
So Im trying to get a drag and drop functionality on to my pet game.

The idea is that you can drag some food over the pet, and drop it on the pet to eat it.

So far I have 2 tags set up "Character" and "Food"

I have an FSM set up that gets mouse down, if food is picked then the food game object follows the mouse around using the Drag RigidBody script.

This all works fine, however I am trying to figure out how to set it up so that the game knows if food is being dragged over or close to the Character and then deciding to send an "eat food" event based off this.

Any ideas?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Drag and Drop
« Reply #1 on: May 28, 2013, 05:46:56 PM »
i would use a collider on the food and when it collides with the dog then you know how close it is. You can use that as a trigger.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D