- Home /
Enemy renderer detaching
Hi all, I've just 'finished' development on my game, an expanded version of the survival shooter tutorial. All seems to be working perfectly besides one strange bug. When playing the exported version of the game on either Windows or Mac an enemy seems to occasionally 'detach' from itself and just follow the player around without being able to damage them. The player can't damage the enemy unless the find a spot on the map where the enemy's light can be seem. If the player shoots at this spot then the enemy will take damage as normal and when damaged enough it will die and jump back to the spot where the light was. I've attached a screenshot demonstrating this but the easiest way for me to show you is in a video. Unsure what the rules are with posting links to external videos but I'll provide one just in case as it'll show what is happening much more clearly than I can describe. So far I haven't been able to replicate this issue in the unity editor, is it possible for bugs to only appear in the built version of a game. I've got no idea how to investigate this as it only seems to be happening in standalone builds. I've also had an issue in the exported builds of the line renderer that forms the player's bullets stopping showing up, the bullets still work as normal but can't be seen. Perhaps the two are linked?
Can anyone recommend how to go about debugging or have any idea why this might be happening? I'm happy to answer any questions or provide any of my code that might help. Thanks!
Link to video: https://www.dropbox.com/s/l77emjzr1liinjm/BugDemo.mp4?dl=0 
Hi,
I have never done this tutorial and I just quickly read your post without really investigate on it, but I am just going to answer one of the questions you wrote.
Yes, it's possible that a bug appears only on standalone builds. From my experience, the only issues of this type I met were issues around execution order : https://docs.unity3d.com/$$anonymous$$anual/ExecutionOrder.html
I mean that if the execution order is not perfectly under control, some instance of your game sometimes need another instance that is actually not created or ready to work yet.
Did you try to build a "develpment build" for Windows and activate the error logs ? You can do this in the build settings. It could help you to figure out what is happening.
Thanks for the response, I'll look into execution order now. I hadn't come across development builds but will certainly investigate to see if this is of any help. Cheers!
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Exported mesh not rendering when Animation Controller is Attached?? 0 Answers
Pink screen when exporting to build. 2 Answers
How come the camera's functions doesn't work in the iOS build? 0 Answers
How do you add a fixed joint to a first person controller 1 Answer