This is looking at the Variable Changed source action and what we can do with it.
The source action was originally designed to work with the Animation variable tracks and action filters.
To see this working as intended please see this video: LINK.
The attache project takes this new source action and I'm now using it to trigger events in the skin using the action filter.
So what does the project do...
Well the idea is when you pan the pano between -10 and +10 degrees you get snow.
Outside of this and it stops.
The skin has a true/false variable: start_snow which is set to false to start with.
The skin also has the snow component and as it don't want snow starting I change the line of code in the text box: snow_code:
From: var snowOnLoad = true;
To: var snowOnLoad = false;
This can be found at the top where it says:
// you can modify these...
var snowOnLoad = false;
var snowFlakeCount = 5000;
var snowFlakeSize = 0.006;
var snowFlakeSpeed = 0.0017;
Then to change the variable I added a timer, this starts running using init.
The time out is: 0.100 seconds
And it repeats, toggles.
The timer has the actions:
Activate, Set Variable Value, True, start_snow
Deactivate, Set Variable Value, False, start_snow
So the timer is toggling the variable between true and false.
There is a graphic that changes colour each time the variable changes to you see a visual representation of this.
I also added a text box to display the pan angle.
The timer then has two more actions:
So as the variable changes the Go to URL actions will be actioned.
To stop the wrong action from being triggered they have Action Filters.
The filter is:
Pan, <=, 10 AND
Pan, >=, -10
So when the variable changes and the pan is between -10 and +10 the snow falls.
The filter is:
Pan, >, 10 OR
Pan, <, -10
So when the variable changes and the pan is below -10 and above +10 the snow stops.
Special forum to share and discuss skins for Pano2VR and Object2VR
1 post • Page 1 of 1
Who is online
Users browsing this forum: SAwity and 2 guests