Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
다양한 배우 운동 지원
웅크리거나 기어가는 것과 같은 다양한 배우의 이동을 지원하려면 :ref:`doc_navigation_different_actor_types`를 지원하는 것과 유사한 맵 설정이 필요합니다.
웅크려 있거나 기어가는 액터에 대해 적절한 높이로 다양한 내비게이션 메시를 베이킹하여 게임 세계의 좁은 구역을 통해 경로를 찾을 수 있도록 합니다.
배우가 이동 상태를 변경할 때, 예를 들어 일어서거나 웅크리거나 기어가기 시작하고 적절한 지도에 경로를 문의합니다.
회피 행동도 이동에 따라 변경되어야 하는 경우(예: 서있는 동안에만 피하거나 동일한 이동 상태에 있는 다른 에이전트만 피하십시오. 각 이동 변경에 따라 액터의 회피 에이전트를 다른 회피 맵으로 전환하십시오.
func update_path():
if actor_standing:
path = NavigationServer3D.map_get_path(standing_navigation_map_rid, start_position, target_position, true)
elif actor_crouching:
path = NavigationServer3D.map_get_path(crouched_navigation_map_rid, start_position, target_position, true)
elif actor_crawling:
path = NavigationServer3D.map_get_path(crawling_navigation_map_rid, start_position, target_position, true)
func change_agent_avoidance_state():
if actor_standing:
NavigationServer3D.agent_set_map(avoidance_agent_rid, standing_navigation_map_rid)
elif actor_crouching:
NavigationServer3D.agent_set_map(avoidance_agent_rid, crouched_navigation_map_rid)
elif actor_crawling:
NavigationServer3D.agent_set_map(avoidance_agent_rid, crawling_navigation_map_rid)
private void UpdatePath()
{
if (_actorStanding)
{
_path = NavigationServer3D.MapGetPath(_standingNavigationMapRid, _startPosition, _targetPosition, true);
}
else if (_actorCrouching)
{
_path = NavigationServer3D.MapGetPath(_crouchedNavigationMapRid, _startPosition, _targetPosition, true);
}
else if (_actorCrawling)
{
_path = NavigationServer3D.MapGetPath(_crawlingNavigationMapRid, _startPosition, _targetPosition, true);
}
}
private void ChangeAgentAvoidanceState()
{
if (_actorStanding)
{
NavigationServer3D.AgentSetMap(_avoidanceAgentRid, _standingNavigationMapRid);
}
else if (_actorCrouching)
{
NavigationServer3D.AgentSetMap(_avoidanceAgentRid, _crouchedNavigationMapRid);
}
else if (_actorCrawling)
{
NavigationServer3D.AgentSetMap(_avoidanceAgentRid, _crawlingNavigationMapRid);
}
}
참고
여러 맵에 대해 경로 쿼리를 즉시 실행할 수 있지만 회피 에이전트 맵 전환은 다음 서버 동기화 후에만 적용됩니다.