Comments (2)
Well, you are defining the behavior of an Actor in potentially three layers. C++, Blueprint, and JS.
And, for example, C++ doesn't know anything about what is defined only at the level of Blueprint, but you can define placeholder functions in C++ and override them in Blueprint. So C++ can call Blueprint functionality that way.
Similarly, Blueprint doesn't know anything about what is defined only at the level of JS, but you can define placeholder functions in Blueprint and override them in JS. So Blueprint can call JS functionality that way.
So create a Blueprint, with an empty function. Extend the generated class of the Blueprint with a JS class using the syntax in the link you found. Override the function in the JS class with whatever functionality you want. Convert the JS class into an Unreal class/blueprint/actor with the require('uclass') syntax shown in the link you found. Create a new instance of this new Actor using the 'new' keyword syntax shown in the link you found. Now that your actor is in the game world if any other actor (defined via C++, Blueprint, or JS) interacts with it and calls that function name, it will execute the JS functionality you defined.
from unreal.js.
好吧,您正在潜在的三层中定义 Actor 的行为。C++、蓝图和 JS。
例如,C++ 对仅在蓝图级别定义的内容一无所知,但您可以在 C++ 中定义占位符函数并在蓝图中覆盖它们。所以 C++ 可以通过这种方式调用蓝图功能。
同样,Blueprint 不知道仅在 JS 级别定义的内容,但您可以在 Blueprint 中定义占位符函数并在 JS 中覆盖它们。所以 Blueprint 可以通过这种方式调用 JS 功能。
因此,创建一个带有空函数的蓝图。使用您找到的链接中的语法,使用 JS 类扩展生成的蓝图类。用你想要的任何功能覆盖 JS 类中的函数。使用您找到的链接中显示的 require('uclass') 语法将 JS 类转换为 Unreal 类/蓝图/actor。使用您找到的链接中显示的“new”关键字语法创建此新 Actor 的新实例。现在,如果任何其他 Actor(通过 C++、Blueprint 或 JS 定义)与其交互并调用该函数名称,您的 Actor 就在游戏世界中,它将执行您定义的 JS 功能。
this is a good idea,Thank you for your reply
from unreal.js.
Related Issues (20)
- Actor.GetActorLocation() working in editor, not in packaged build HOT 1
- Unable to build for Android on UE5 (5.0.3) 😭 HOT 4
- What is this principle? HOT 1
- how to user GWorld.GetActorOfClass() HOT 3
- After packing, Blueprint.Load is invalid HOT 6
- don't override blueprint method
- Not working in UE 5.1 HOT 10
- Make a proper documentation PLEASE! HOT 1
- Pass js vaiables to blueprint HOT 3
- [Question] Use this as ingame scripting? HOT 9
- UE5.03 Build for android "lv8_monolith" issue HOT 1
- Program crashes
- Not able to build with version 5.2 HOT 1
- Failed to package ue5.1 to linux. Procedure HOT 1
- Failed to package for windows
- Unreal 5.3 support HOT 10
- How to include npm packages? Ethers.js? HOT 1
- How to bind UMG Widget to JS? HOT 2
- How to Debug JavaScript with Rider ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unreal.js.