Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: gregacuna on April 21, 2020, 08:57:20 AM

Title: Setting Game Object at Runtime
Post by: gregacuna on April 21, 2020, 08:57:20 AM
I'm using Playmaker and the Corgi Engine for my new game. Up until now I've been using a Player Prefab I created and have it set in Corgi as the Player, but now I've made an Avatar Creator which saves the Player Avatar as a Game Object variable, but I can't just set it at runtime. I know this has something to do with setting an Object variable, but I just don't understand the procedure for doing this. Is there any documentation about the order of setting up an Object variable, getting the property of the component which needs to be set and then setting it???
Title: Re: Setting Game Object at Runtime
Post by: gregacuna on May 09, 2020, 07:49:28 AM
Bump...any ideas?
Title: Re: Setting Game Object at Runtime
Post by: ch1ky3n on May 09, 2020, 10:48:09 AM
Do you mean GameObject Variable?
What type of variable is Player Avatar that you mention?

Try to figure out the script in the Corgi engine that contains the Prefab of the player.
drag it and check call method (If they have swap sprite method or something)
otherwise use set property and find the variable that holds the prefabs

good luck!

Title: Re: Setting Game Object at Runtime
Post by: gregacuna on May 16, 2020, 02:44:01 AM
Sorry for the late reply...ran into so many problems trying to replace the player variable at runtime that I've pretty much given up at it right now. Hope to return to this issue later and see if I can learn enough to fix it. Really appreciate the help!
Title: Re: Setting Game Object at Runtime
Post by: Thore on May 16, 2020, 07:31:33 AM
I also got the Corgi Engine in one special offer sale, a while ago. It looked very custom, no Unity physics but its own system etc. That’s a perfectly reasonable approach for many types of platformers, “classic” ones and especially considering that Unity’s 2D features are fairly recent. However that approach imposes a dilemma: you can use it right away and it’s fairly easy, but once you want to step out of that box, it’s much harder because you need a good grasp of coding to understand how they build it (so you can adapt it).
Title: Re: Setting Game Object at Runtime
Post by: gregacuna on May 16, 2020, 08:34:49 AM
@Thore I've been working on a new game using Corgi for about six months now and it gets extremely difficult for non-coders when trying to customize it. Good luck.