â ī¸ All examples in this Observe/Override method ShootEvents.OnEnter to gain access to stateContext.
AdjustTransform
Base class for AdjustTransformWithDurations. Seems to do nothing if passed to adjustTransform scriptable parameter. Do not use: your movement will be blocked indefinitely until you reset adjustTransform.
AdjustTransformWithDurations
Discovered by void*
Request to change player trajectory (view angles) and/or player position.
Function has 3 types of behavior: set trajectory, set position or set both.
Changing player's trajectory to custom angles
This code will smoothly point your camera towards {0, 0, 0}.
local adjustRequest = AdjustTransformWithDurations.new();-- Setting any duration to 0 or lower means "do not change"-- Slide = change player position-- Rotation = change player rotation / trajectory / viewing anglesadjustRequest:SetSlideDuration(-1.0); -- Disabling position adjustionadjustRequest:SetRotationDuration(1); -- Rotation show be smooth and should happen in 1 second (presumably, second!)adjustRequest:SetUseParabolicMotion(true); -- Do not just interpolate movement/rotation, use parabolic formulaadjustRequest:SetCurve(CName.new("None")); -- Setting curve to "None", no other curves were found in the sourcesadjustRequest:SetRotation(ToEulerAngles {0, 0, 0}:ToQuat()); -- Setting target player's rotationstateContext:SetTemporaryScriptableParameter("adjustTransform", adjustRequest, true);
How it looks in-game
Targeting an GameObject for trajectory
Does not change player's pitch.
Seems to target "nearest" targeting component (aka hitbox).
SetRotation is ignored if target is set.
Will freeze player in place/in air while it's aiming (same behavior as LookAt)
local adjustRequest = AdjustTransformWithDurations.new();adjustRequest:SetSlideDuration(-1.0); -- Disabling position adjustionadjustRequest:SetRotationDuration(1.0); -- Rotation show be smooth and should happen in ~1 second (presumably, seconds!)
adjustRequest:SetUseParabolicMotion(true); -- Do not just interpolate movement/rotation, use parabolic formulaadjustRequest:SetCurve(CName.new("None")); -- Setting curve to "None", no other curves were found in the sources-- In this case aimAt is a GameObjectadjustRequest:SetTarget(aimAt); -- Setting target player's rotationstateContext:SetTemporaryScriptableParameter("adjustTransform", adjustRequest, true);
This function seem to use TargetingSystem to find the "best component" and then calls a LookAt.
local adjustRequest = AdjustTransformWithDurations.new();adjustRequest:SetSlideDuration(1.0); -- Setting duration of position change.adjustRequest:SetRotationDuration(-1.0); -- Disabling rotation adjustionadjustRequest:SetUseParabolicMotion(true); -- Do not just interpolate movement/rotation, use parabolic formulaadjustRequest:SetCurve(CName.new("None")); -- Setting curve to "None", no other curves were found in the sources-- Getting player's positionlocal playerPosition = Game.GetPlayer():GetWorldPosition();-- Adding 10 on the vertical axisplayerPosition.z = playerPosition.z +10;adjustRequest:SetPosition(playerPosition);stateContext:SetTemporaryScriptableParameter("adjustTransform", adjustRequest, true);