How can I achieve a item drop effect from games like Diablo/Path of Exile?

I’ve been searching for a while on the topic and haven’t come to any answers so posting my question here. How should one try to replicate the item drop effect from mentioned games? To clarify, by item drop I mean the spinning & pathing of the item from the player to the ground. I managed to implement a system to just spawn it in a radius of the Player and check for collisions before spawn, but I can’t seem to get this effect I want.

I tried adding impulses on the Z and Y axis however this always results in the item just sliding away from the player. I want them to travel a predefined curve if possible.

Untitled-1
This is a rough drawing that hopefully describes what I am after. The item spawn point would be in the center of the Player and the item actor will have no collision with him at until it hits the ground.

Another thing regarding this that I do not understand is how in the mentioned games, the Items slam into the ground rapidly after moving a bit from the Player. I tried tweaking mass values but it always falls kind of slowly.

Hi Curse,

Glad to hear you’ve already experimented with impulses. I don’t know if you’d need to treat the item as a projectile. (Projectile Movement Component) - But you may be able to utilize the ‘Suggest Projectile Velocity Custom Arc’ node.

There is also a ‘rotating movement component’ you could add to your items to give them some spin.

I understand what you’re saying about how the items are falling slowly. I think to get a fast arc you’d have to go more along the route of 1. calculating the arc 2. animating the item along that arc at set speed.

Interesting problem with a lot of potential directions, hope that helps!

download my game and see if pickup&drop system will help you.

I checked it out and its really similar to what I currently have, for the drop I mean. Not exactly what I was looking to implement. A fixed curve from A to B would be the closest to what Im looking for.

image

Experiment with something along the lines of:

  • in the player:

This is just a random upward facing cone. Fiddle with the Angle and Force multi. This can be dramatically improved with another method if insufficient. Do tell if you need a suggestion.

  • in the dropped item:

It starts ignoring the Pawn but once its overlapping Sphere collision volume has left the player, the regular Physics profile is restored after 1s.

1 Like

Do you want to drop the item onto a specific location? Are we dropping a single item at a time?

The way that I set it up so far:

-First I get a random distance from the players location

-I use this distance to do a box collision starting from the players location to the randomly generated distance from above

-This keeps going until there is nothing in the way (no collision was detected). I have a for loop doing this (50 iterations, just for testing, doesn’t handle situations where there is no viable space). When no collision is detected the end spawn point is the Player location + random distance from above

What I thought was when I generate this end point, I spawn the item actor in the middle of the Players mesh and use that as the starting point of the drop. The end point being the one generated from the box collision function. I wanted to try to implement a way where the item goes from the start to said distance over a curved-like path.

This what you posted above is really nice :smiley: The only problem I see with it is how do I check for collisions with it before spawn? To clarify, I do not want items spawning into a wall/other object.

Edit: Forgot to mention that when the item is spawned I turn on simulate physics and disable the collision. Once the item hits the ground the physics is turned off and the collision enabled again.

From the Player to a specific location yes. One item at a time.

What I suggested would work, it does respect collision, it wouldn’t get stuck in obstacles, and the physics sim can be switched off. One thing it does not do is to check whether another item is already there - so you may end up in a situation where one item is neatly on top of another - if this is a no-go, then we need to work a bit harder that what I suggested.

I use this distance to do a box collision starting from the players location to the randomly generated distance from above

This could work, sure but it also could be somewhat inconsistent - what if there’s a telephone pole between the player and the target location? A top-down trace would ignore it and it would appear like a valid location. Consider a box trace from the player’s position towards the target - to clear the entire flight trajectory.

I wanted to try to implement a way where the item goes from the start to said distance over a curved-like path.

2 methods come to mind when targeting a specific location:

Physics prediction

Less control, easy to set up, somewhat unpredictable but physics sim can look nice & natural, until it gets iffy and doesn’t:

You could play with the above, it actually does tracing but you do not get to choose what it ignores, you may want to trace manually the way you already do or the way I suggested above.

Spline

Lots of control, but can be somewhat rigid at times. It could look like so:

  • the player spawns the item, feeds it data from the trace:

  • the dropped actor that has no collision whatsoever to start with drops itself onto the safe target location:

You get to define the spline and the TL curve as needed - it can be dynamic, too. In the anim above I’m using cursor location - you’d have a safe location from tracing, offset by half the height of the item so they do not sink into the ground.


As always, the crux is in the details so you may want to massage some values to make it feel right.

4 Likes

Wow I didn’t know about splines till today I guess :smiley: Never knew you could use them with timelines like this. I played around with it today and learned more about the entire system and to be honest this is exactly what I was looking for! I managed to fit your implementation within my system, now it’s just a bit of tweaking the curve and doing the correct numbers but I love this system.

Thank you very much for the solution, you truly are a hero o7 :heart:

3 Likes