Verse Library verse

01 Fragment

Moves a placed car prop forward by calculating its forward vector and using MoveTo.

verse-library/verse-car-build-primitive/01-fragment.verse

# The heart of "build the car primitive": find a tagged prop and move it.
car_body_tag := class(tag) {}

NudgeOne(Body : creative_prop)<suspends> : void =
    Current : transform = Body.GetTransform()
    Forward : vector3 = Current.Rotation.GetLocalForward()
    Target : vector3 = Current.Translation + Forward * 250.0
    Body.MoveTo(Target, Current.Rotation, 0.6)

Comments

    Sign in to vote, comment, or suggest an edit. Sign in