To be able to manipulate your own custom mesh as a creative_prop you need to go through the steps to make a custom prop out of your mesh, which are described here Converting Assets into Props. Is that the issue you are encountering?
I’m also facing an error related to this. I have all like you said but when I run the game this error is shown: Error: VerseRuntimeErrors: GetTransform called on disposed object. Use .IsDisposed[] to check before calling.
I was cheking everything in the editor but I do not found anything that could help me to fix this issue.
My code is running twitce when the loop starts.
I mean, MoveTo is executing slower than the loop, then if I code 1 sec in OverTime on MoveTo, the rotating bar start flashing because its trying to do two movements in one.
Is there any way to fix this issue? I tryied with Sleep(SpeedTime) but its always stopping double time than MoveTo function.
I finnaly found this way to fix it and I hope that the comunity could use it until you can fix it.
Here is the code fully code!
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Simulation/Tags }
using { /Verse.org/Concurrency }
# A Verse-authored creative device that can be placed in a level
RotateLowBar := class(creative_device):
@editable LowBar:creative_prop = creative_prop{}
@editable RotationsPerSecond:float = 60.0
var Speed:float = 0.7
muevelo()<suspends>:void=
var result: move_to_result = LowBar.MoveTo(LowBar.GetTransform().Translation, LowBar.GetTransform().Rotation.ApplyLocalRotationZ(360.0),(Speed))
if(result = move_to_result.DestinationReached):
muevelo()
OnBegin<override>()<suspends>:void=
muevelo()
If this isn’t working there are two things you can check. First, it could be that GetAnimationController[] fails which means the whole block is skipped. Second, it could be that the prop you are trying to animate is not animatable. To check this you can check if (AnimationController.GetState() = animation_controller_state.InvalidObject).
@Incredulous_Hulk
Thanks for that code sample! It works really well when the object isn’t rotated, but it can cause desync when the object is already rotated. Maybe there is ambiguity about which direction it should rotate since it’s the same distance rotating either direction. I think it’s fixed by picking a smaller increment than PI. I went in 4 deltas of 1/2 PI each and that seems to work.
Thanks!
Sounds like the quaternion interpolation checkbox we do in the sequencer, which helps solve it there, so maybe if you try to replicate what that setting does in code, it may solve it.