Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 4-Nov-2014 12:54:00

zhangxiaomin
Member
Registered: 29-Oct-2014
Posts: 7

How do to check the display status of a object or node?

I am working a scene that a object takes different actions depends the other one's status of display. Like a man who is crossing a road, when the light is green, he can walk,but when the light is red, he should wait for the green light. I am working with the "counter" plugit to simulate the logics. But are there any plugits more fit for the scene?

Offline

#2 4-Nov-2014 14:45:35

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,091
Website

Re: How do to check the display status of a object or node?

you can use the animation switcher plugIt
default anim : idle / wait
walk anim

add a distance plugit near the pedestrian crossing.
when the distance send In event you check if he can walk

distance.in -> switch red light state.input
switch red light state.left (it's green) -> do nothing
switch red light state.right(it's red) -> anim switcher.default
switch red light state.right(it's red) -> path / track.pause

red light state red -> switch red light state.switch right
red light state green -> switch red light state.switch left

this need more test for green light you can add an another switch to keep the state of the character in the distance
distance.in -> switch in dist.switch right
distance.out -> switch in dist.switch left

switch in dist.switch right -> anim switcher.walk
switch in dist.switch right -> path / track.play

red light state green -> switch in dist.input

Offline

#3 6-Nov-2014 04:13:01

zhangxiaomin
Member
Registered: 29-Oct-2014
Posts: 7

Re: How do to check the display status of a object or node?

You are so kind, thanks a lot.

Offline

Board footer

Powered by FluxBB