Tuesday, 22 April 2014

Work I've done over the Easter break.

Due to some unforseen circumstances (which will be ongoing till the end of this project) I have not been able to complete as much work during the holidays as I would like to have done.

Over the holidays I had planned on testing out the Pressure Plate script I had been working on leading up to the holidays. I also wanted to complete the Player Health script so that our player would die once the enemy had "hit" our player.

For the player death I was looking at the Unity Script Reference website:

https://docs.unity3d.com/Documentation/ScriptReference/Object.Destroy.html

I was looking to 'Destroy' the Player Game Object once the alien had entered the collider with the trigger.

Object.Destroy

e.g. static void Destroy(Object obj, float t = 0.0f);

"The object 'obj' will be destroyed now or if a time is specified 't' seconds from now. If 'obj' is a Component it will remove the component from the GameObject and destroy it. If 'obj' is a GameObject it will destroy the GameObject, all it's components and all transform children of the GameObject. Actual object destruction is always delayed until after the current Update loop, but will always be done before rendering".

With this, and after watching some JavaScript YouTube tutorials (couldn't find any C# videos for this, which was very frustrating), I tried to incoporate it in to the Player Health script we have. As of yet I am having no luck with it working (to be honest it's probably something really simple and I just cannot for the life of me see it at this moment in time, hopefully someone else in the group might be able to spot it for me).

No comments:

Post a Comment