dr01d
New Member
Posts: 5
Posts: 5
|
Post by dr01d on Sept 19, 2016 3:07:22 GMT
Hi,
I have been tested many methods to set up the player spawning and I currently have a not so ideal solution working, but would like assistance on a better way.
Currently I have the player being spawned by the player spawner (outside poolboss) (first life), with respawning coming from the poolboss (2nd and 3rd life using respawn in killable, and recycle in poolboss) this seems to be working mostly OK in terms of G.O states and lives/health. Ive got some minor issues with the follow player spawner as it seems the player is respawned in the original spawn location then moved to the previous death location making a particle trail between those points; and I cant hook in other assets as there is no player prefab available as it is not in poolboss. Do i need a script to spawn the player in the pool on game start or include the player in the first wave? Or is there a better way?
Thanks
|
|
|
Post by DarkTonic Dev on Sept 19, 2016 5:30:13 GMT
If you don't want the respawn to happen at original spawn location, set the RespawnPosition property of the Killable component (sounds like you're using that?) when he dies before despawning or at a checkpoint.
I don't understand how you're using Killable for this when there's no player prefab though....so I can't answer the other question yet. It seems like if you have a Killable script then there's a prefab.
|
|
dr01d
New Member
Posts: 5
Posts: 5
|
Post by dr01d on Sept 19, 2016 14:19:20 GMT
Hi,
Sorry not overly clear, hope this is a bit easier. Yeah I don't want to respawn at the original spawn location, I am using the playerspawner script to set the spawn position with follow player checked. The reference to the player prefab in the playerspawner script is from the prefabs folder. The playerspawner script spawns the prefab outside poolboss and I think when the player dies it respawns (via player killable respawn settings) using a poolboss instance of the player prefab. I am not using any other way to spawn the player into the game. This setup doesnt seem the best way to do it (likely the cause) but it does work with the world variables health/lives and Game over states fine. The player respawns in the original spawn position set in the playerspawner script.
The problem arose when I wanted an offscreen HUD indicator (VR) script to reference the player prefab, which I couldnt do because the playerspawner script seems to spawn the prefab at runtime and therefore not available to select as a target in the editor.
So I just need to work out how to best spawn the player into the game that is available to select in the editor as a target for the offscreen HUD indicator, and a way for the respawn to use the players death position instead of the original spawn position. I am still testing a number of methods but none seem to work with those two requirements yet. If you have any ideas, that would be fantastic. I can include setting screenshots if that makes things easier.
Cheers
|
|
|
Post by DarkTonic Dev on Sept 19, 2016 16:10:39 GMT
I think you'll to notify that HUD script after the player spawns, with code. Can't really assist more than that.
|
|
dr01d
New Member
Posts: 5
Posts: 5
|
Post by dr01d on Sept 21, 2016 1:41:23 GMT
Thanks, I will give that a try. The developer of the HUD asset has it working with Playmaker so I might look at that. With placing the player in the scene It all works great, I just dont get the respawn where player dies. I will take another look at the playerspawner script to see what I can do. I am a bit closer, cheers.
|
|
|
Post by DarkTonic Dev on Sept 21, 2016 4:02:58 GMT
ok cool.
|
|