I dont know why but now it works. but I dont changed something
strange
---------edit-----------
ok I know when this happens.
when I load a prefab and rotate it with SetRotation() the prefab falls through my ground. when I dont SetRotation() its ok.
works
Script.ItemPath = "" --path "(Prefab) Item"
Script.MaxItems = 5 --int "Max Spawn Items"
Script.DroppedItems = 0 --Number of Items dropped
function Script:DropItem() --in
if(self.DroppedItems < self.MaxItems) then
self.DroppedItems = self.DroppedItems + 1
System:Print("Drop")
self.prefab = Prefab:Load("Prefabs/test.pfb")
--SpawnPosition is Pivo Position
self.prefab:SetPosition(self.entity:GetPosition().x,self.entity:GetPosition().y,self.entity:GetPosition().z)
--Rotate Prefab
--self.prefab:SetRotation(0,90,90)
--self.prefab:PhysicsSetRotation(0,90,90)
else
System:Print("maximal items dropped")
end
end
dont works
Script.ItemPath = "" --path "(Prefab) Item"
Script.MaxItems = 5 --int "Max Spawn Items"
Script.DroppedItems = 0 --Number of Items dropped
function Script:DropItem() --in
if(self.DroppedItems < self.MaxItems) then
self.DroppedItems = self.DroppedItems + 1
System:Print("Drop")
self.prefab = Prefab:Load("Prefabs/test.pfb")
--SpawnPosition is Pivo Position
self.prefab:SetPosition(self.entity:GetPosition().x,self.entity:GetPosition().y,self.entity:GetPosition().z)
--Rotate Prefab
self.prefab:SetRotation(0,90,90)
--self.prefab:PhysicsSetRotation(0,90,90)
else
System:Print("maximal items dropped")
end
end
even when I uncomment the PhysicsSetRotation() Function it wont work.