playMaker

Author Topic: Cloning Objects Question  (Read 2613 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Cloning Objects Question
« on: June 30, 2021, 10:38:29 PM »
Hello,

I am using create object action to create clones of my game objects. However, it seems that it modifies different properties of the clones. I don't think it is due with other FSMs interacting with it, but there's always a slight chance I'm wrong on that (though I really don't think so as I checked pretty carefully). Do clones interact differently or is there something else I'm missing? To give you specifics of what is happening, after my character clones itself and the clone it won't be able to get attacked or the original object will get destroyed even if it was the clone that was attacked. I guess what I'm asking is, do clones act the exact way as there original counterparts? Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Cloning Objects Question
« Reply #1 on: July 01, 2021, 07:20:33 AM »
Hi.
If you have References to the Character and you make a 'Clone'
the refences will not reference the clone.

also a Clone usually gets named Character (Clone) so if you would try to find by name you need to search for "Character (Clone)" or rename the clone after created.


misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Cloning Objects Question
« Reply #2 on: July 01, 2021, 11:03:44 AM »
So, I'm trying to rename the clone after it has been created (figured that would deal with any references in case I had them). I tried using the set name action, but it wouldn't let me put in the game object field until the clone was actually created in game. I tried getting the name of the game object (get name action), setting it to the clones name, and then renaming the clone (using set name action). No dice. I finally tried creating an empty game object with the clone's name and then setting the name to the standard object (using set name action) in hopes it changed both but it didn't work. I checked for correct spelling and capitalization but still nope. Any thoughts on what I'm doing wrong? Thanks!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Cloning Objects Question
« Reply #3 on: July 01, 2021, 04:00:37 PM »
Hi.

Quote
the clone it won't be able to get attacked

Can you give more detail on how the enemy find player to attack

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Cloning Objects Question
« Reply #4 on: July 01, 2021, 06:48:33 PM »
So, its actually a multiplayer game, sort of like smash. Except when you kill your opponent, as well as them respawning, you get a second copy of yourself that you have to manage (kind of like pinball except they all are controlled by one set of controls). The player must ground pound to attack and then there are hit boxes that sense the collision (trigger2d event or collision 2d event, one of them). Then it deactivates that player and I use the create object action in order to duplicate myself and then I just reactivate the killed player. Hopefully that gives you enough information. Thanks so much for your help!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Cloning Objects Question
« Reply #5 on: July 02, 2021, 08:53:22 AM »
Hi.
So attacks will trigger by tag/layer

do you have trigger/collider events set to "on trigger/collision enter" or on 'stay'

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Cloning Objects Question
« Reply #6 on: July 02, 2021, 10:13:01 AM »
Everything is set to stay now (like you recommended in a previous post :) ) and now I think the only issue is that when a clone gets killed, it will kill the original, not the clone. Also, this is a slight issue, but the death counter doesn't register for the clones. I think the answer to both solutions is renaming the object, but it doesn't let you do that until the object is created in game. How do I go about doing this? Thanks!

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Cloning Objects Question
« Reply #7 on: July 07, 2021, 02:07:32 PM »
Bump.

...

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
Re: Cloning Objects Question
« Reply #8 on: July 07, 2021, 02:18:35 PM »
Of course it doesn't let you rename the game object until it's created, what would it rename otherwise, prefab name?

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Cloning Objects Question
« Reply #9 on: July 07, 2021, 02:22:54 PM »
Sorry for the dumb question. How do I go about solving it though?

...

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
Re: Cloning Objects Question
« Reply #10 on: July 07, 2021, 04:21:07 PM »
There's no dumb questions, but i'm not sure the way you're making things is a proper one. So the clones are for the player? And you want to rename them to what? Player1, player2, player3...?