|
Post by Dionysos on Sept 12, 2016 15:14:15 GMT
Hi,
I got a question about the killable script.
When i use the script on 3d objects it works just fine but i when i add a button on my canvas and add the killable script on it, it doesn't work anymore, it does work when i manually despawn the button or damage it.
I need this so players can press a button on the canvas and go to the next wave (repeat wave until world value is above).
Thanks in advance.
|
|
|
Post by DarkTonic Dev on Sept 12, 2016 16:22:58 GMT
Killables need rigidbody and collider to be able to take damage normally. I've never seen a canvas object with a rigidbody. If this is really what you want, you will need to add those components (I don't think it's what you want).
Or you could add code so that when you click the button, it goes to the next wave or whatever.
|
|
|
Post by Dionysos on Sept 12, 2016 17:42:36 GMT
When i put a collider on the button it works, the button despawns and i go to wave 2.
only thing now is it won't respawn on the canvas. i don't think this is effective either and it probably won't work this way.
What i'm trying to do is: wave 1 infinite until player clicks on a button, when clicked on the button > go to wave 2 (boss round), wave 3 infinite until clicked, then boss round etc. But the button needs to despawn when clicked on and when the player kills the boss it needs to respawn after 10 min in wave 3, so the player is forced to play wave 3 at least 10 min before advancing to wave 4.
I don't have a lot programming skills i'm still learning the basics so if you could help me out here it would be a lifesaver.
Thx
|
|
|
Post by DarkTonic Dev on Sept 12, 2016 19:19:19 GMT
To make the button respawn on the canvas, you'll have to write some code to set the parent after it spawns. You'll also have to write code to wait 10 minutes. I'm not going to write the code for you but it's pretty basic. You can always ask on the Unity scripting forum if you get stuck.
-B
|
|