mkafrin/PolyZone

[Help Request] Entity Zone not giving output

Opened this issue · 4 comments

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

Image attached for reference.
image

[Solved]
Seems that because I had used the offset to move the zone past the center of the vehicle, it cancelled out the zone interaction.
I removed the forward offset yet left the rest and it now works.
If any explanation could be given on the issue I would appreciate it.

Hmm, I don't believe this is intended behavior. At least, it seems to me that what you attempted should be supported, or if it can't be, a descriptive error should be returned rather than silently failing. Let me do some testing to find the root cause and see if a fix is possible.

Hmm, I don't believe this is intended behavior. At least, it seems to me that what you attempted should be supported, or if it can't be, a descriptive error should be returned rather than silently failing. Let me do some testing to find the root cause and see if a fix is possible.

I have same problem i have a casino box zone Im leaving the zone but not giving me false output.