Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass js vaiables to blueprint #332

Open
Precognist opened this issue Apr 14, 2023 · 3 comments
Open

Pass js vaiables to blueprint #332

Precognist opened this issue Apr 14, 2023 · 3 comments

Comments

@Precognist
Copy link

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?

@getnamo
Copy link

getnamo commented Apr 16, 2023

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

@mich123king
Copy link

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

@getnamo
Copy link

getnamo commented Jul 25, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants