Guys and ladies, i build inventory system and now want to drop item.
But now it’s spawning on the ground.
how to change this blueprint for drop it like from the hands from this direction
thanks)
You aren’t returning anything in the case the branches fail.
Maybe add a sequence node before everything, have the first pin going to that set LSpawnLocation, and have the second pin going to a return node returning LSpawnLocation.
but actor spawning in my situation, but on the floor, or i incorectly understand u)
It’s working because you’re clamping it to the ground (Clamp Ground is true). Meaning it will spawn on the ground.
But you don’t want it to spawn on the ground. Meaning you have to set clamp ground to false, and when you do that, the function with just return {0,0,0}. You have to return LSpawnLocation when it’s false.
Thanks) it’s now droping like from hands)
can u help one more time please?
How to set direction from me to ground but like with some angle?
I’m not completely sure what you’re asking, but you can use the world rotation of your camera to make it face the same direction you’re looking.
i mean i want to make droping item from hands little far from player like throwing away
In that case, you just have to increase this number from 50 to something higher:
yes, but it will be drop at this point not from character, vertical down
but i want to drop it from character on 0 point but on hands height to 100 point from character on the floor
like on image)
You need to make sure what you’re spawning is some base class that all the items inherit from. Given it has custom parameters like item object and the like, I’ll assume you’re doing that already.
Here’s an example of how to implement it with the first person template character as an example. (Of course, this won’t actually work since the player doesn’t do physics, but it works for showing logic)
You first spawn the actor like you already are, then you get a reference to the root component (in this case capsule component)
After that, you set the linear velocity using the forward vector of the camera so it throws it where you’re looking.
Of course, you need to make sure the root component is physics ready.
thanks) i’ll try)