playMaker

Author Topic: help string to gameobject variable conversion [SOLVED]  (Read 6523 times)

paul.harden

  • Playmaker Newbie
  • *
  • Posts: 6
help string to gameobject variable conversion [SOLVED]
« on: August 08, 2011, 07:26:32 AM »
Hi all,
I'm stuck on trying to call a series of numbered objects via playmaker..
I need to move first Object_01, then object_02 and so on.

This is the way I begun:
float add + convert float to string + build string (the first string is appended to the base name of the object).
So I end up with a nice string with the final number incrementing at each mouse press)
Now I suppose I'll need to convert this string to a gameobject variable, I tried with "set game object" but it
requires a gameobject variable to start from.. so I'm stuck!

Can somebody please help me, perhaps suggesting another approach to the issue?
thanks!
« Last Edit: August 08, 2011, 12:55:46 PM by paul.harden »

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • Permaximum Betty
Re: help string to gameobject variable conversion
« Reply #1 on: August 08, 2011, 07:45:48 AM »
Hi all,
I'm stuck on trying to call a series of numbered objects via playmaker..
I need to move first Object_01, then object_02 and so on.

This is the way I begun:
float add + convert float to string + build string (the first string is appended to the base name of the object).
So I end up with a nice string with the final number incrementing at each mouse press)
Now I suppose I'll need to convert this string to a gameobject variable, I tried with "set game object" but it
requires a gameobject variable to start from.. so I'm stuck!

Can somebody please help me, perhaps suggesting another approach to the issue?
thanks!

Well I guess you need to find the gameobject first in the scene.
Im not so sure I understand what you try to do.

giyomu

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 108
    • blog
Re: help string to gameobject variable conversion
« Reply #2 on: August 08, 2011, 09:02:19 AM »
you cant convert a string to a gameobject, the only thing you can do with yoir string is find a gameObject.name equivalent, so you compare your string variable with the gameobject.name and if they match you can then store this gameobect for your need.

you can use find game object action which allow you to search by name or tag and store your find.

paul.harden

  • Playmaker Newbie
  • *
  • Posts: 6
Re: help string to gameobject variable conversion
« Reply #3 on: August 08, 2011, 12:55:14 PM »
Thanks! i'ts just what I was looking for,
I see it this way: find gameobject does the conversion and checks for the existence of the target.