Digi_056 Posted August 9, 2023 Share Posted August 9, 2023 (edited) local function OnGetItemFromPlayer(inst, giver, item) local x, y, z = inst.Transform:GetWorldPosition() y = 3 local angle if giver ~= nil and giver:IsValid() then angle = 180 - giver:GetAngleToPoint(x, 0, z) else local down = TheCamera:GetDownVec() angle = math.atan2(down.z, down.x) / DEGREES giver = nil end item.Transform:SetPosition(x, y, z) launchitem(item, angle) end Here's what I've got so far, I want to return the original item back to the player, but this just places the given item into the prefab's inventory and then does nothing after. I'd like it to fling the item back out instead of simply refusing to take it in the first place. Edited August 18, 2023 by Digi_056 changed code highlighting Link to comment Share on other sites More sharing options...
Digi_056 Posted August 18, 2023 Author Share Posted August 18, 2023 I was messing around and put inst.components.inventory:DropEverything() overtop item.Transform:SetPosition(x, y, z) and now it works.....yay Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now