Jump to content

Engine.GetSimRate/SetSimRate from JS script


Recommended Posts

Hi guys!

I'm working on a new script and I was wondering if there is a way to execute Engine.SetSimRate / Engine.GetSimRate from JS trigger script? It works if executed directly from the console, but using these functions inside JS produces following error:

ERROR: Error in timer on entity 1, IID103, function DoAction: TypeError: Engine.SetSimRate is not a function

This is my test trigger:

Trigger.prototype.TestDelay = () => {
	Engine.SetSimRate(20);
}

const trg = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger);
trg.DoAfterDelay(5000,"TestDelay", {enabled: true});

I'm on release-a27.1 6a576.

Do you have an idea how to change simulation speed from within javascript? Is it even possible using trigger mechanics?

Thank you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...