MoveTo and TeleportTo should be implemented in creative_object

I can not wrap my head around the fact that I can call MoveTo and TeleportTo on creative_prop but not on something like a damage_volume_device.

It’s such a basic concept that all objects should be moveable using these functions, it should be up to the creator if something can be moved unless there is a very good reason otherwise (EX: Someone trying to move a creative_device that does some kind of magic in the background of the game engine that relies on it not moving, in which case those devices should explicitly be defined as unmovable and override MoveTo and TeleportTo to do nothing)

Moving a damage_volume_device was a key concept to a map I’m working on, I thought about using a loop that checks each players distance to a creative_prop with a static mesh attached and if the distance is small enough issue damage to that player. That is just silly though.

1 Like

You can just make an empty prop and then put whatever you want inside that (as a child). Works fine.

1 Like

Hello @Nman_Pkr !

Here is a link to a tutorial on how to move a device by making it a child of an empty Building Prop. Hope it helps.

Moving Objective Marker

1 Like

I see, I’m going to try this now. I’m ok with this solution, just “feels” wrong, but I can live with it if it means I can move my damage_volume_device(s). Thank You!

I am still having an issue, I can now rotate a damage_voume_device using Verse and MoveTo, however I am getting what I can only describe as a “tearing” effect. To help isolate the issue I’ve created a new map and setup a BuildingProp blueprint actor with the damage_volume_device attached as a child. I kept the Verse as simple as possible and tried a few different varations. I’ve also tried changing the amount of radians I rotate in one MoveTo call and playing with the duration, but I still ultimately end up with a volume that glitches back to random positions while rotating.

Version one of the Verse I tried:

Sorry first part has to be left out of a Code Block because the forum webpage freezes the second I try to paste or type ‘[’ or ‘]’

RotateTag := class(tag){}

RotateProps := class(creative_device):

# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
   if(SelectedProp := creative_prop[GetCreativeObjectsWithTag(RotateTag{})[0]]):
        spawn:
            RotateProp(SelectedProp)
    RotateProp(TheProp : creative_prop)<suspends> : void =

        CurrentTransform := TheProp.GetTransform()
        CurrentTranslation := CurrentTransform.Translation
        CurrentRotation := CurrentTransform.Rotation

        NewRotation := CurrentRotation.ApplyYaw(90.0)
        MovedAsset := TheProp.MoveTo(CurrentTranslation, NewRotation, 2.0)

        #Others claim this fixes this bug, it does not. I believe
        #you should only be able to get to this point after the Prop hits its 
        #destination anyways, otherwise the function would not run recursively 
        #it would hit the condtional statement as false and exit
        #Tested by using Print statements and they are 2.0 seconds apart
        if(MovedAsset = move_to_result.DestinationReached):
            RotateProp(TheProp)
    

Also tried a super simplified version thinking maybe Verse has an issue with the fact I pull the data into constants each time in a recursive function (Garbage Collection?)
Again sorry Code Block is causing issues here, I think this is attempt 16 at editing this draft?

RotateProp(TheProp : creative_prop) : void =
#Obviously one line, Thanks Code Blocks!
MovedAsset := TheProp.MoveTo(TheProp.GetTransform().Translation, TheProp.GetTransform().Rotation.ApplyLocalRotationZ(90.0), 2.0)

    if(MovedAsset = move_to_result.DestinationReached):
        RotateProp(TheProp)

Longer Video Version: glitch_video.mp4 - Google Drive

Short Version:

[Edit] This happens with other props too that are not children of a parent BuildingProp, just not anywhere near as bad (Very subtle glitch / springback)

1 Like
# Makes a `rotation` by applying `YawRightRadians` of left-handed rotation around the local +Z axis to `InitialRotation`.
(InitialRotation:rotation).ApplyYaw<native><public>(YawRightRadians:float)<transacts>:rotation

I think you should use radians:

NewRotation := CurrentRotation.ApplyYaw(DegreesToRadians(90.0))

After much more testing I have found that I have to use TeleportTo and basiacally adjust the radians and sleep time using the following verse to mimic MoveTo. It is a hack at best and I truly believe there is something wrong with MoveTo under the hood that needs to be addressed.

    RotateProp(TheProp : creative_prop)<suspends> : void =
            CurrentTransform := TheProp.GetTransform()
            CurrentTranslation := CurrentTransform.Translation
            CurrentRotation := CurrentTransform.Rotation

            NewRotation := CurrentRotation.ApplyYaw(0.05)

            if(TheProp.TeleportTo[CurrentTranslation, NewRotation]):
                Sleep(0.05)
                RotateProp(TheProp)
1 Like

Is it possible to find out if a prop has a device child and then be able to change its settings? In the example in the link, would I be able to find the marker via verse and then change its settings without manually adding it to the verse device?

I am able to reference children of a parent prop with Verse tags applied to the child device separately. I have a Building Prop blueprint with a Verse tag on it that has a damage_volume_device child with a separate Verse tag. I use the tag on the Parent to move it thus also moving the damage_volume_device that is not competent enough to move by itself. Then I use the Verse tag on the Child (damage_volume_device) to do things like Subscribe events, enable damage, disable damage, etc.

You are right, I forgot to convert degrees to radians, however it doesn’t make a difference it still does not rotate correctly. I was hoping it would when I went to try it considering 90 radians to degrees is over five thousand degrees, would have made perfect sense haha. When I tested it with 0.05 (which is about 2 degrees) it glitched as well.

[Edit]I am going to hook a button event up to the function and step it without calling it recursively to see if I glitches when stepped one MoveTo at a time.

Then my question would be: Can you reference the tag through the prop with some method? I have several props that each have an associated prop mover, but I’m struggling to find some way to connect them without manually adding everything to a verse device. I know you can add tags to things and find them that way, but not in a consistent order. I need each prop mover to be paired with the correct prop.

Hello, have you found a solution or workaround for this?

Not for this issue but I noticed that we can also use sequencer to attach device to prop. This means one device could be attached to different props at runtime by switch different sequence to run.

We are actively working towards supporting TeleportTo and MoveTo for any creative_object.

2 Likes

That’s great news, Thanks for the feedback!