Unreal.js icon indicating copy to clipboard operation
Unreal.js copied to clipboard

Pass js vaiables to blueprint

Open Precognist opened this issue 1 year ago • 3 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?

Precognist avatar Apr 14 '23 22:04 Precognist

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

getnamo avatar Apr 16 '23 04:04 getnamo

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

mich123king avatar Jul 25 '23 10:07 mich123king

See subclassing section https://github.com/ncsoft/Unreal.js/wiki/Subclassing

And for basics try the video tutorials: https://github.com/ncsoft/Unreal.js/wiki/Video-tutorials

getnamo avatar Jul 25 '23 16:07 getnamo