Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: paul.harden on August 08, 2011, 07:26:32 AM

Title: help string to gameobject variable conversion [SOLVED]
Post by: paul.harden 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!
Title: Re: help string to gameobject variable conversion
Post by: Damian 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.
Title: Re: help string to gameobject variable conversion
Post by: giyomu 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.
Title: Re: help string to gameobject variable conversion
Post by: paul.harden 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.