Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
clone enemy share the same health as the original

Registered User
2023-01-07 16:28:56

I try try to figure out why my cloned enemy share the same health as the original, because when I kill a clone, the original and all other clones die at the same time. I searched on the forum, but I'm not sure I understand. Although I'm sure this subject was brought many time before.
I'm sure the solution is with javascript.

Edit: I solved my problem. Needed to change delete node in my original node to current scene node instead of enemy.

Well , nobody answered. Too bad for me. Still happy I could solve this. Good day to everyone.

2023-02-08 09:06:24

Glad you found a solution. People need time to respond to posts on the forum, we weren't ignoring you.

Whenever I clone an enemy, I have the original node "hidden" and placed at position "0,-1000,0", below the map/terrain and can't be shot or collided with during game-play.

When I clone it, I then make the cloned nodes visible (but keep the original untouched and hidden) -so all clones are new and fresh. This way, new clones will always have full health and coppercube automatically calculates any new damage to health and implements death animation etc for each clone.

If you decide to clone a game character after it's been killed, the new node will also have zero health - you can replenish health using the special vaiable (hash) This would probably become confusing if you're using script/code - but I think you can get the clones unique node ID and then set it's health that way.

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "Internation?l" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact