fix: pass scale to UEPseudo UWorld::SpawnActor #864
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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::SpawnActor
hardcodes the scale to 1.0:and the second
AActor* UWorld::SpawnActor(UClass* Class, FTransform const* Transform)
needs anFTransform
which 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
FTransform
to 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.