- Home /
Endless DeathZone??!!?
Hi How Can I Create An Endless DeathZone Which has a width but it's endless from length sth like the one seen in 2dgameplay tutorial i read those but i found nothing Helpful can some one help me about that endless Bounds maybe?!?!
Endless DeathZone, I don't get it? If endless, you will keep on falling and falling (what a game!!!) until Unity starts to go jerky on the float values. Detail a little more please.
Guys Guys I'm still willing to know about those bounds stuff!! :(
Answer by fafase · Aug 25, 2012 at 07:58 AM
Ok, as I said the box is not infinite, it is actual not possible to do something like:
var box:BoxCollider;
function Start(){
box =GetComponent(BoxCollider);
box.size.x = Mathf.Infinity;
}
What you think is infinite is only real long, look at this:
this is taken out of the box, no change at all.
Answer by Kacer · Aug 23, 2012 at 11:40 AM
You could have anything that moves beyond a certain point.
pseudocode:
if(transform.position.x >= 10){
Destroy(gameObject);
}
If you attach a script like this to an object it should be destroyed when it moves beyond 10x
Answer by behzad.robot · Aug 23, 2012 at 04:36 PM
nope i already have my deathZone which Says as soon as Player EnteredYourTrigger You Destroy it but I Want it to be Endless Bound like the one in the 2d gameplay tut!
please dont add comments as new answers, use the "add comment" ins$$anonymous$$d.
Also, have you tried the answer i posted, it does not rely on triggers.
yap i have and it works but i was trying to learn Bounds stuff i'm really interested in it i can also $$anonymous$$ake $$anonymous$$y Own Trigger Really Big Too but i wanted to learn How To create such a bound!
don't break ur head with unecesary stuff go the simplest way :D
Answer by fafase · Aug 24, 2012 at 04:04 PM
OK , the lerpz tutorial HAS a box, a box collider exactly set to IsTrigger. That is what you want. You position your box which has bounds as it is a box and add this:
function OnTriggerEnter(other:Collider){
if(other.gameObject.tag =="Player")other.gameObject.transform.position =Vector3(0,0,0);
}
Assets/_Scripts/DeathZone.js(5,43): BCE0053: Property 'UnityEngine.GameObject.transform' is read only. From These Line: if(other.gameObject.tag =="Player") other.gameObject.transform =Vector3(0,0,0);
Also Why will these make box collider endless?
what do u mean with endlesS? could u plz explain that cuz is confusing
Yes i care about it being endless i can handle other parts by myself :)
could u xplain it then? cuz nobody seems to understand. what are u callin endless exactly
I fixed this error, i was missing position. And yes, what is the endless? Nothing in nature is endless, neither is a game.
Your answer
Follow this Question
Related Questions
How to load a scene on collision 2 Answers
How to play an audio one shot clip on a collision 1 Answer
How to destroy a gameobject on collision 2 Answers
How to make movement on camera on button down. 1 Answer
Scene Audio Script Error 2 Answers