playMaker

Author Topic: How do I set a Gameobject variable to nothing?[SOLVED]  (Read 5111 times)

4ppleseed

  • Full Member
  • ***
  • Posts: 226
How do I set a Gameobject variable to nothing?[SOLVED]
« on: December 06, 2013, 11:15:56 AM »
Hi, I want an On Touch Event Down to store the last touched object as a GameObject variable – no problems, so far.

Then when you let go, On Touch Event UP I want it to NULL out the GameObject  variable.

How do I set a Global GameObject variable to nothing/Null/empty?

Thanks.
« Last Edit: December 10, 2013, 01:38:16 PM by jeanfabre »

1982

  • Junior Playmaker
  • **
  • Posts: 71
Re: How do I set a Gameobject variable to nothing?
« Reply #1 on: December 06, 2013, 06:04:31 PM »
Hack solution: Create another new Gameobject which you save into that variable, and then destroy it.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: How do I set a Gameobject variable to nothing?
« Reply #2 on: December 06, 2013, 06:32:04 PM »
Use the set gameobject action but don't enter a gameobject :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do I set a Gameobject variable to nothing?
« Reply #3 on: December 06, 2013, 06:35:30 PM »
Use the set gameobject action but don't enter a gameobject :)

this

undefined = null
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: How do I set a Gameobject variable to nothing?
« Reply #4 on: December 10, 2013, 10:28:19 AM »
Use the set gameobject action but don't enter a gameobject :)


Ahhhhh... that's so simple I couldn't see it. Thanks!

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: How do I set a Gameobject variable to nothing?[SOLVED]
« Reply #5 on: January 09, 2014, 05:29:02 AM »
Can anyone tell me why this isn't working?

The object is null so it should end up in state 4 not 5.

I'm getting the information from a hash table.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do I set a Gameobject variable to nothing?[SOLVED]
« Reply #6 on: January 10, 2014, 08:18:49 AM »