Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Collison Question

Twistted Hand
Registered User
Join date: 15 Mar 2006
Posts: 1
10-06-2006 07:21
Im trying to make a door script like others ive seen. When you go to the door it automaticly opens up for you from either direction you are walking into it. Ive heard its a collision script, but i cant find it anywhere nor can i figure out how to create it. Any help?

Thanks
HtF Visconti
Registered User
Join date: 21 Jul 2006
Posts: 123
10-06-2006 07:28
Usually the door has an invisible, phantom part that is bigger than the door and extends into the room. In this prim llVolumeDetect() is used to recognize the collision. Depending how your door is built (monolithig as single object or door/hinge as a standalone prim) you then pass a message to the door that will open when closed.

Use linked Messages for monolithic doors and llSay() or llWhisper() for non linked doors.

The door should have a variable that tells it if it is open or not and maybe a timer to auto close after a while.

I'm at work else I could offer you a sample script but I think that the above principle should get your started.
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
10-06-2006 16:59
You probably don't want to use llVolumeDetect() with a linked detector prim... because the entire door would become phantom, and thus defeat the purpose.

Use a simple collision_start() event. Inside that event, call a second state, such as state open. The open state would A) open the doors, B) set a timer to hold the doors open, and C) close the doors and call state default when the timer() triggers.