Game Development Reference
In-Depth Information
Requesting states
Requesting a state in the ASM sets the next state the ASM will transition to without force-
fully setting the state immediately. Requesting a state allows the ASM to transition between
the current state's animation and the next state's animation based on the blend duration and
the blend window:
Sandbox.lua :
function AnimationStateMachine.RequestState(self, stateName)
if (self.nextState_ == nil and
self:ContainsState(stateName)) then
local currentState = self.currentState_;
if (currentState == nil) then
self:SetState(stateName);
else
self.nextState_ = self.states_[stateName];
end
return true;
end
return false;
end
Search WWH ::




Custom Search