Garry's Mod Wiki

NPC:NavSetWanderGoal

boolean NPC:NavSetWanderGoal( number xOffset, number yOffset )

Description

Sets a goal in x, y offsets for the NPC to wander to

Arguments

1 number xOffset
X offset
2 number yOffset
Y offset

Returns

1 boolean
Whether path generation was successful or not

Example

Given an NPC makes them wander to a location 100 units in both the x and y directions

if IsValid( npc ) then npc:NavSetWanderGoal( 100, 100 ) npc:SetSchedule( SCHED_IDLE_WANDER ) end

Page Links


Special Pages


Wikis

?

Render Time: 83ms

DB GetPage 54
Generate Html 8
SaveChanges (1) 12
Render Body 0
Render Sidebar 6