Jason Campbell Posted April 5, 2020 Share Posted April 5, 2020 Hello all,I've finally got a loot box that spawns a random item inside it.Problem is it places it at the very bottom of the chest, so it can't be seen.Any way to spawn it in the center of the transform of the box?Thanks%trans is the chests transform %lootItem = new Item() { datablock = %item; static = true; rotate = false; }; %trans=%obj.getTransform(); %lootItem.setTransform(%trans); Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted April 5, 2020 Author Share Posted April 5, 2020 I figure it out. I re-imported the box with the center at where I wanted the item to spawn. Works great now. Quote Link to comment Share on other sites More sharing options...
Duion Posted April 6, 2020 Share Posted April 6, 2020 I hardly know any games that actually spawn items inside boxes, in most games you click the box and a GUI opens that shows that there is an item in the box, while there is actually nothing inside it for real. Other games spawn the items outside of the box when you "open" it or it is destroyed. Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted April 6, 2020 Author Share Posted April 6, 2020 I got it working pretty slick now. I have a random item(weapon, health kit, ammo, ect) spawn right before the open lid animation. I wanted it to occur without a GUI. I have a button press to pickup stuff so this works well. Quote Link to comment Share on other sites More sharing options...
fLUnKnhaXYU Posted April 6, 2020 Share Posted April 6, 2020 you can use vectorAdd in the case that you might want to add a large item and make it appear above the prize box . Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted April 6, 2020 Author Share Posted April 6, 2020 Nice! Thanks f. That is what I was looking for originally. Quote Link to comment Share on other sites More sharing options...
Duion Posted April 7, 2020 Share Posted April 7, 2020 If it appears on top of the box anyways, you can shoot a raycast from the top and it will always spawn exactly on top of the surface, start 1.5m from the top or so in case it is indoors so it will not spawn on the upper floor. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.