Forum Discussion
Jürgen_Schoene_
6 months agoCommunity Member
the new emphasize animations are solved with normal javascript in user,js, e.g.
function ExecuteScript(strId) {
switch (strId) {
case "5iJndnVgyvU": // trigger on timeline starts
Script1();
break;
case "6NRem5OttDF": // trigger emphasize animation
Script2();
break;
}
}
window.InitExecuteScripts = function () {
var player = GetPlayer();
var object = player.object;
var addToTimeline = player.addToTimeline;
var setVar = player.SetVar;
var getVar = player.GetVar;
window.Script1 = function () {
console.log("hallo world");
};
window.Script2 = function () {
const target = object("60g35ET153K");
const duration = 750;
const easing = "ease-in-out";
const id = "6l0E5nUIcp0";
const growAmount = 0.2;
player.addForTriggers(
id,
target.animate([{ scale: `${1 + growAmount}` }], {
fill: "forwards",
duration,
easing,
})
);
};
};
- Jürgen_Schoene_6 months agoCommunity Member
the consequence is
- that if you use javascript triggers and you have a script error, the emphasize animations will not work throughout the training
- the script error message in the browser console can now be found differently
-> at the very beginning, not when the script is used
- SamHill6 months agoSuper Hero
Ah, thanks.