I followed this tutorial to pickup objects up and drop them on pressing “f”:
I got the same result as the tutorial but they are using first person blueprint and I want to do so on third person blueprint between 2 actors… I don’t get the same output on third person blueprint (see images)
I used follow camera instead of first person camera but nothing actually happens… Any idea how to make it work?
Instead of shooting the linetrace out from the 3rd person camera, you want to shoot it out from the player controller or the player. The first person camera works because it is where your player is, the third person camera is behind your camera, so chances are your raycast isn’t hitting anything. I would get your player location and shoot it from the player’s forward vector instead.
Notice how I add the forward vector * 300 to the location in order to get the line start, and then add forward vector *600 to the location to get the line end. You can tweak the numbers, but just hook up the new line start and line end to your thing and it should be working fine.
+TestyRabbit
Thanks for the clarification… I did the 2nd solution. It didn’t work still though. It’s showing a blue line trace that moves with the character but still I can’t pickup the object or drop it when I press “F”.
Please help, I know there is something wrong with my code but I just don’t know what it is exactly.
Sorry for the late reply. Remove the draw debug line node and put the start and end values into the line trace node where they should go. I was using draw debug line to test out where the linetrace would go
The only reason I could see it not picking it up is if your cube isn’t simulating physics, and is therefore failing the “Is Simulating Physics” check. I have attached an image to show you were to print to see if this is the case. Check your cube you’ve placed into the scene to see if it is simulating physics.
That’s what I imagined. so go into your editor, click on the cube you are trying to pick up, and make sure the simulate physics tab is checked under the physics section.
It picks it up automatically because your Event Tick function is attached to the Set Target Location node. that probably is why it’s not dropping either.
+TestyRabbit when i break the link from event tick to set target location, nothing works… any idea how to fix this to let the pickup and drop process starts only when I press “F”?
I was having issues with this too. To fix it you just need to unlink the Set target location node from the LineTraceByChannel and replace it with the Pickup Custom event.