Hey everyone, I’m fairly new to unreal engine 5 so, can anyone help me make a pick up and drop/throw system and you can pick up again after dropping for a first person horror game? It’s like the system that fears to fatham uses.
I already have a simple interaction system using interfaces. [here’s a pic if you wanna see]
I had to lookup and watch segments of a Lets Play to see the system, so I am unsure if this is the full extent:
there are objects in the world that can be picked up, manipulated, and placed back down.
when the player “interacts” with the objects they are placed in the character’s “hands” (they float in front of the camera)
when the player triggers the “drop” action the object is removed from the character’s “hands” and placed on the nearest valid surface (if there isn’t one then the object remains in the character’s “hands”)
if this is incorrect please be more descriptive then just a game name, maybe a video with a timestamp showing what you are trying to replicate.
this style has been used in a number of games, and is not that uncommon, but keep in mind that it does come with some drawbacks and issues.
object scaling needs to be understood and respected, for both the object being moved around, and the character if it’s scale is not set to (1,1,1)
attaching and removing objects leads to bookkeeping steps that might not seem intuitive until you think about it.
if the object is being managed by something else you might need to respect that.
the following is a strategy to mitigate most of that:
what I would suggest is: Give your character a StaticMeshComponent “ItemSlot” (for now just 1, but more could be useful) for the objects to go when they are “being held”.
when the object is being “picked up” get the StaticMeshComponent OtherMesh with a FindComponent off your trace set that ItemSlot Static mesh to be the StaticMesh of the OtherMesh.
on the OtherMesh Actor disable its collider, and disable its rendering (change the HiddenInGame to true), and be sure to put the actor into a local variable.
when the object is being “dropped” detect if there is a valid spot to put it down, and if there is set the StaticMesh of the ItemSlot to None, Teleport() the OtherMesh Actor to the new location, turn the renderer on the StaticMesh back on, and re-enable its collision.
once the item is turned back on set that stored Actor reference/pointer to none.
if you wanted multiple positions for objects then you can have additional “ItemSlots” but you are responsible for the book keeping.
to figure out which items can and cannot be picked up, or what “itemSlot” to put them into you can use the Tag system, or for the items that can be picked up you can inherit from StaticMeshActor to give it like an offset, or an itemSlot index of some kind.
Hey, sorry for a late reply. I just want to drop the object anywhere in the world. It doesn’t need a specific place or vaild surface. Just drop or throw. Here’s a video if you wanna be more clear…
In 2:40, like how he picks up the chips bag and drops it, I just want this type of system.
It would be really helpful if you could give me pics.