playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
Setting up prefab to find a gameObject at runtime
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Setting up prefab to find a gameObject at runtime (Read 1746 times)
richardh
Junior Playmaker
Posts: 97
Setting up prefab to find a gameObject at runtime
«
on:
February 01, 2015, 04:22:32 AM »
Can someone tell me how to setup a prefab that requires an object in the scene at runtime please?
The link between my FSM and the player is lost once I make the FSM part of a prefab So i need to reference the player so the prefab finds it at runtime. But I can't figure out how.
What events do I need to use please?
thanks
R
Logged
richardh
Junior Playmaker
Posts: 97
Re: Setting up prefab to find a gameObject at runtime
«
Reply #1 on:
February 01, 2015, 08:03:55 AM »
So, to be a bit clearer, if I want to reference a gameObject in a prefab so that when the prefab is created in the scene it will find the gameObject, what do I do?
thanks
Logged
richardh
Junior Playmaker
Posts: 97
Re: Setting up prefab to find a gameObject at runtime
«
Reply #2 on:
February 01, 2015, 10:00:54 AM »
I think I've sussed it.
I created a global gameObject variable called 'Player'.
In the prefab I used event 'Find Object' :
object name [none]
with tag [Player]
store [global/Player]
This seems to work. Is this the right approach?
thanks
R
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
»
Setting up prefab to find a gameObject at runtime