Jump to content


Photo

Selecting an object as a variable


  • Please log in to reply
4 replies to this topic

#1 The Legend

The Legend

    A Jesus Freak

  • GMC Member
  • 1052 posts
  • Version:GM:Studio

Posted 24 April 2012 - 08:29 PM

How can I set a variable to equal an object that is between the AI and its target?
  • 0

#2 thegame

thegame

    Flying Penguin

  • GMC Member
  • 1407 posts
  • Version:GM:Studio

Posted 24 April 2012 - 08:53 PM

variable = foundObject;

Edited by thegame, 24 April 2012 - 08:54 PM.

  • 0

#3 The Legend

The Legend

    A Jesus Freak

  • GMC Member
  • 1052 posts
  • Version:GM:Studio

Posted 24 April 2012 - 09:16 PM

Can you elaborate?
  • 0

#4 thegame

thegame

    Flying Penguin

  • GMC Member
  • 1407 posts
  • Version:GM:Studio

Posted 24 April 2012 - 09:20 PM

foundObject = collision_line(); //You fill it it, as I know nothing of your objects
Then, if you need to set something to this object that is now in foundObject, set it like a normal variable.

Collision line returns the id of the object that it finds. You can then store the id in a variable and use the object like foundObject.x = 5;
  • 0

#5 The Legend

The Legend

    A Jesus Freak

  • GMC Member
  • 1052 posts
  • Version:GM:Studio

Posted 24 April 2012 - 11:08 PM

Thanks.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users