I need to set up a system where I can pick up and throw objects, I’ve used the class blueprint described here as a starting point. My guess is I need to add a impulse to the object to the OnReleased and OnInputTouchEnd, I’ve attached an image of where I’m at, considering this is a class BP I’m not sure how to get the First person camera into this BP as a way of generating a vector for the impulse. Any suggestions would be greatly appreciated
You could use a ‘get player character’ node, then cast to your character -> then as your character you’ll be able to access any of the character components (i.e. camera).
Hello,
To loot item, you need to create a pick up item blueprint where you will set all infos related to your weapon. With infos, in your character, you can set your inventory and add it to your weapon list / system. If you equip it, you’ll need the reference of the mesh to attach. when equip, you use this mesh to attach to a socket of your character and when you throw it, you destroy the mesh (not the component but the mesh in it) and spawn a projectile like in the projectile system (blueprint and use in character blueprint) in first person project with the related mesh you are throwing .
This is a class blueprint for the item that will be picked up and thrown in this instance a rock. What I’m trying to do in the example is to add a new pin to the sequence node connected to the onRelease node and get this to throw the rock with a random impulse (velocity that is) based on the direction the camera is facing. At the moment I’m at a beginner level with blueprints and still trying to get an understanding of the mechanics of BP, I understand the concept of casting but not quite sure how to get that info into the impulse vector of the add impulse node. I’m not quite sure if this is the correct way to do this due to my noobish scripting level
So, I’ve moved this on slightly and I’m a bit stumped - I’ve used the player camera manager -> get camera rotation -> get forward vector -> mult that vector by a large float and linked that to the impulse - no joy - Any suggestions please