Hey there, folks,
I’m facing a slight issue at the moment, I’m trying to have objects generated randomly around the map, which ideally will be placed on the ground correctly, hence why I wish to use the PlaceObjectOnGroundProperly() function.
My issue however, is that despite generating the object, using this method, having the object account for gravity, having a blip to identify the object still exists, even using a debug line to show the distance to the object… it doesn’t always show on the “ground”.
datapack = CreateObject(model, nx, ny, GetGroundZFor_3dCoord(nx, ny, 1000), true, true, true)
PlaceObjectOnGroundProperly(datapack)
SetModelAsNoLongerNeeded(model)
SetEntityAsMissionEntity(datapack, true, true)
datapack_blip = AddBlipForEntity(datapack)
SetBlipSprite(datapack_blip, 161)
SetBlipColour(datapack_blip, 4)
-- SetBlipAlpha(datapack_blip, 0.5)
SetBlipAsShortRange(datapack_blip, true)
BeginTextCommandSetBlipName("STRING")
AddTextComponentString("Unknown Signal")
EndTextCommandSetBlipName(datapack_blip)
(Not sure why it’s not formatting correctly, my apologies)
But yes, despite attempting to get the highest Z point, then placing on the ground correctly (removing this line doesn’t fix the issue), just seems like I’m going around in circles.