Hey! so im making some sort of survival game and im making items spawning on invisible parts, and i want to make it so whenever the part spawns it will spawn above the invisible part (the size of the invisible part is 1,1,1) and they need to spawn like laying above the invisible part, heres an image to describe how it should be:
But instead they are spawning floating like this:
Heres the script (and also the invisible part is turned so the items spawn laying above it at the right orientation)
Wdym by checking the cframe? every item is the exact size of the mesh it just rotates to the cframe of the spawn part, maybe use different angles to go up?
You can’t take Item.Size.Y if you’re rotating the part.
Because let’s say you have a part that is (1,4,1), but you rotate it so it lays down. Then it looks like it’s (1,1,4) but it is still in fact (1,4,1)
And then if you tell the script to offset the item by item.size.y/2+spawnPart.size.y/2, then the part will be 2.5 studs above the spawnPart (or something like that)
I was thinking about it tho is it a problem? bc if it is then how will i make it rotate like if its laying down? (simulating someone put it in there (also like piggy intercity for an example))