playMaker

Author Topic: Setting Game Object at Runtime  (Read 1483 times)

gregacuna

  • Full Member
  • ***
  • Posts: 142
Setting Game Object at Runtime
« 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???

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Setting Game Object at Runtime
« Reply #1 on: May 09, 2020, 07:49:28 AM »
Bump...any ideas?

ch1ky3n

  • Full Member
  • ***
  • Posts: 208
Re: Setting Game Object at Runtime
« Reply #2 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!


gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Setting Game Object at Runtime
« Reply #3 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!

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Setting Game Object at Runtime
« Reply #4 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).

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Setting Game Object at Runtime
« Reply #5 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.