ncsoft / Unreal.js

Unreal.js: Javascript runtime built for UnrealEngine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass js vaiables to blueprint

Precognist opened this issue · comments

How do you store the variables/actors created in js to blueprint? Let's say I'd like to pass the actors created in the helloWorld.js to the blueprint running the js component.

actor = new TextRenderActor(GWorld,{X:100,Z:100},{Yaw:180})

How would I do that?

You could e.g. write a blueprint function with an actor param on a uobject you have access to in Js e.g. another bp actor you spawned, then call the function with the Js object and unreal.js will automatically cast and convert V8 types to the unreal ones.

Usually I get a reference to the owner of the JavaScript component and add some utility functions on that actor for e.g. book keeping or comms.

Subclassing a c++/blueprint actor with common api is another way to communicate.

The wiki is probably the best place for examples: https://github.com/ncsoft/Unreal.js/wiki

Hello, did you manage to do that I cant understand the docs.?