now to the things i made. my character has a srpingarm attached to the camera, so the movement should look more realistic. i added the linetrace function. now i want to pick the object up, when i can interact with it, and place it somewhere else.
any ideas how i can do this? i followed some tutorials, but they were not compatible with the linetrace BP i had.
Sadly, it does not. Normally you’d trace, fetch an actor reference and use it to attach to a component or a socket. Can you explain what’s not working about something like that?
my character has a srpingarm attached to the camera, so the movement should look more realistic.
This is also confusing, why are we mentioning the camera (what is its role in the holding an object system - do you have a separate torso / head movement / control the arms independently?) and why is the springarm attached to the camera? Normally, it’s the other way round.
but they were not compatible with the linetrace BP
If you have an issue with something specific, shoot.
now i got a result, after i changed something. my character is now “holding” the item, but it doesnt shake a little bit, so it looks awful. is there a way to use a similair function like the camera shake function?
So the item is suspended in mid air in front of the character and you need it to have some independent bob-about movement, and you were hoping to use a spring arm for that? Could work… but!
Any reason why you’re not using a Physics Handle? It already does all what you ask. Do tell, perhaps you hate the handle for some good reason. This:
I sometimes use springarms for strange things but this seems to work out of the box:
Find a tut on that one component specifically. It’s only useful if you want physics. Otherwise it may get iffy. And a springarm (or manual vector interpolation) could work better.
Don’t want to derail the thread, but are you going to implement this in every actor that needs picking up? And give every object access to the player BP? Sounds like a little nightmare waiting to happen.
Consider doing it in the player if you want to use the springarm:
If you use physics, take advantage of the Physics Handle instead - more natural approach.
You can still use the interface call for something else - like for checking whether this item can be picked up or to make it do something special, play a sound, for example.
Avoid giving random stuff in the world direct access to the player.
the only problem is, that the integers are not correctly transmited between the BPs and i am unable to change the holding item, with the placed one.
i tried to do a “grid” system, where the “ghost” object is invisible and when you are in his near, you can see it. that should show the player where he can put the item he has. after that the “ghost” object should be deleted and replaced with the hold item