Ability - Drop item on floor at player position

I'm making an ability that drops an item at the players feet, and so far I have it getting the player's position and placing the item there, but how do I get the item placed on the ground at their feet rather than in the middle of the player - also resting on the floor and not through the floor?

Here is my ability function that drops the item:

function OnExecute_DropItem(ability)
	local playerPos = ability.owner:GetWorldPosition()
	local myItem = World.SpawnAsset(propItem, {position = playerPos})


I just recently started to use this game creator so you might wan to wait and see if someone comes with a better solution but the way i would do it is to use a raycast.

Check the raycast example in the documentation https://docs.coregames.com/api/world/#raycast it can measure the distance to the ground.

Now you should probably not use this distance directly because it will put the center of your gun at ground level so half the gun will be buried and probably fall thru the ground.

Normally in any other game engine your gun is just a single mesh so you can get it's collision box size or extents and calculate how much further away from origin is the bottom of the collision box then you would subtract that value from the raycast vector. In core i don't know if you can even get the collision box you can get a collision property of the CoreObject:
but that just returns an Enum:
that tells you if collision is on or off.
Even if that is possible you will still have the problem that the meshes in Core are usually created thru kitbashing so you would have to calculate the bottom of every mesh that is part of the weapon and check with one is further away from origin.

All that being said is probably easier to use a fixed value to subtract from the raycast a value that by testing you find to be good for all weapons in your game.

But like i said probably someone else knows a better solution.

Thanks, I'll try that out and see how it goes. ...

Raycast did work well for this. Thanks!