|
How would I go about achieving this? I'm looking for a way to prevent sequence breaking in my game and am under the impression this would stop that from happening.
(comments are locked)
|
|
If you have a rigidbody on your gameobject you can use the velocity value to determine if your player has died. http://unity3d.com/support/documentation/ScriptReference/Rigidbody-velocity.html
if you are using a Character controller you might be able to do the same, im not sure though :) edit: Well, that would be quit dangerous, because say, your character can be boosted somehow to go faster with bonuses or else, then checking for velocity would create conflict.
May 04 '11 at 08:48 AM
Jean Fabre
well, the y value should exceed that unless he falls for too long, or recieve a boost. alternately he could check if the collider havnt been grounded for a certain time, so ex:(look at my edit)
May 04 '11 at 09:53 AM
Kacer
This is definitely what I was looking for. Thanks a bunch for the help!
May 05 '11 at 01:49 AM
MK7
(comments are locked)
|
|
Hi, I would build a simple collider below your platform, and when the player hit that collider, it means death. then you can easily define several similar colliders around your levels at different height. This would prevent always checking in an update, that's not very efficient. Bye, Jean
(comments are locked)
|
|
well you could make it so that if your player falls to a certain point, then you basically respawn it to another.... Here is a script that i use:
where it says " attach this script to your player game object... hope this helps -Grady (script from tornado twins) I like your script , but i keep on running into this error code: Assets/_3scripts/fall.js(4,14): BCE0020: An instance of type 'UnityEngine.Transform' is required to access non static member 'position'.
Aug 02 '12 at 01:21 AM
vakuzar
(comments are locked)
|
