Hi! I’m super new to Unreal and I have been trying to find a way to make it that when a character in 3rd person walks onto an object, the object will move. For context, it would be a box floating in water that the player would jump on to float to another destination. The tutorials I’ve seen have the object move linearly with InterpToMovement (which doesn’t look like floating) and I’ve seen some with movement along a spline, but haven’t seen any have the spline movement be triggered when the character hops on. I’m not too concerned about the up and down bobbing motion - just more so not having a linear path! I really appreciate it and the more in-depth beginner friendly, the better
appreciate it and the more in-depth beginner friendly
- an actor with:
- a static mesh component (the white platform)
- a spline that has 1s duration (by default) and some points added right in the actor’s viewport
- a yellow-ish box collision we can step into
- script inside this actor; when we step into the box:
- check if the platform is already moving
- set its speed
- play a timeline that is 1s length (see below)
- read the transform at spline’s time and apply it to the platform static mesh in local space
- the timeline:
- lasts 1s
- interpolation ensures smooth start / stop
- the result:
- modify points in the viewport:
- this will ensure uniform velocity distribution regardless of the distance between spline points:
More script will be needed if more features are desired, ofc.
Good luck!
2 Likes
Thank you so much!!
1 Like