fix: pass scale to UEPseudo UWorld::SpawnActor#864
fix: pass scale to UEPseudo UWorld::SpawnActor#864massclown wants to merge 1 commit intoUE4SS-RE:mainfrom
Conversation
|
This breaks from UEs API. An alternative is to expose the overload that takes FTransform to Lua. |
I haven't reviewed the code but it seems relatively benign if we could have an extra overload that just has scale without breaking the others and with still allowing us to have an FTransform version. I guess it's possible it could cause issues in the future if UE does another overload that somehow won't work with our overloads, but that seems unlikely. |
|
I can take a stab at implementing the FTransform API with a table of tables like: Would that be better? |
I would prefer it, but I'm not gonna block the original idea that just adds the Scale3D param, up to you to decide now. If you do go ahead with the |
Description
Currently in UE4SS it is not easy to spawn scaled actors from Lua, and for some actors setting scale after spawning may not work (animated characters, etc.).
In Re-UE4SS/UEPseudo/blob/main/src/World.cpp, the first implementation of
UWorld::SpawnActorhardcodes the scale to 1.0:and the second
AActor* UWorld::SpawnActor(UClass* Class, FTransform const* Transform)needs anFTransformwhich is not passed through Lua currently.To follow the style of the existing API, we add another Lua overload, that also accepts one more, the fourth table parameter, a FVector-like table of scale:
and constructs an
FTransformto call the relevant second implementation from UEPseudo.The original
SpawnActor(UClass ActorClass, FVector Location, FRotator Rotation)should still work as before.Type of change
How has this been tested?
Built locally and tested manually.