PDA

View Full Version : Open gate when camera is near


dkchandler
07-16-2013, 12:24 PM
I know this is probably super simple, but I can not get it to work. I just want to let the user move around in the world with the mouse and when they get close to the haunted gate it opens. I am using the 'gate distance to camera' and it is not triggering the gate to open???? Any suggestions? Thanks

Dan

Alice 2.3

dkchandler
07-16-2013, 01:07 PM
I figured it out.... I needed to use an IF statement and wrap that in a WHILE loop.

Dan

chickentree
07-17-2013, 10:20 AM
I figured it out.... I needed to use an IF statement and wrap that in a WHILE loop.

Dan

You could also use an event. This would be more efficient than doing it in a method and Alice keeps track of continuously checking the event.

Mark

AliceMaster00
07-30-2013, 05:38 PM
if camera is within <threshold> of <gate-name>
do
{
<whatever>
}
else
{
nothing
}


sorry if this is confusing, im used to scripting in C# and Java, so i tried my best to match the visual scripting.

Basically, just grab the function stated above (within threshold of),
then put in whatever you'd like the gate to do. If you're making it open, i suggest creating a dummy facing the direction you would like the gate doors to face when open. Then move the dummies(one for each door) about a meter or 2 forward(make sure axis zed"blue axis" is facing the angle the doors are going to swing open to). After thats done in the do section of the if statement put this

if camera is within <threshold> of <gate-name>
do
{
do together
{
<gate-door-1> face (orient to) <dummy1>
<gate-door-2> face (orient to) <dummy2>
}
}


placing a "turn" function would make the doors turn every time you got near them, and you'll end up with the gates doing 360's through walls (if you had)
or if you used a "while" function as well.