Skip to content

[Help Request] Entity Zone not giving output #72

@Datsun-Drift

Description

@Datsun-Drift

I have created an entity zone for a vehicle and set the offset as desired. Zone creates w/o error.
Debugging is on to ensure I enter the bounding box.
I'm using onPLayerInOut for the coordinate definition and toggling a variable via isPointInside.
When the player ped enters the zone, I have it set to print the value of the variable, but nothing happens at all.
Not sure what I may be doing wrong here, as I have successfully created & used entity zones in other projects.
code snippet provided below.

function CreateVehicleZone()
	local VehZone = EntityZone:Create(TruckData.Id,{
		name = 'DeliveryVehicle',
		useZ = true,
		debugPoly = Cfg.DebugTruck,
		offset = {-5.0,0.7,0.0,0.0,0.0,0.0},
	})
	VehZone:onPlayerInOut(function(isPointInside,point)
		if isPointInside then
			inVZ = true
			print('inVZ: '..tostring(inVZ))
		else
			inVZ = false
			print('inVZ: '..tostring(inVZ))
		end
	end)
end

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions