Download

Help With Gravity Gun Blueprint

So I was following a tutorial (https://wiki.unrealengine.com/Pick_Up_Physics_Object_Tutorial ) and ( https://www.youtube.com/watch?v=WUprlq8aibc&index=12&list=PL7w32vKj19IcQyF6y-uQ23My-z0fajGk- ) but for some reason it isn’t working for me. Here’s some various screenshots I’ve taken.

2.PNG . If anyone knows what’s wrong please let me know :slight_smile: . I’m completely new to UnReal so I’m sorry if it’s a stupid mistake.

Thanks!

Your screenshots are very difficult to read at their current size.

Are you able to update the thread with larger versions so that its easier to see?

I could do loads of zoomed in ones if that would help

Anything that enlarges them with enough detail to make out exactly what it is your attempting to do would be great.

The problem is that your images are not even a high resolution, try maximizing the graph to your full screen before taking screenshots.

Hopefully this is better:

On your right mouse button event, wait until you trace and confirm that the actor hit is simulating physics before you try and add the physics handle and set the physicsHandleActive bool to true.

You are also taking the rotation of your pawn and saying it is the rotatio of the other actor.

There also isn’t much info on what is happening so I am assuming that it just doesn’t appear to be doing anything. Is the line trace hitting the object you are looking at? If so, confirm that it is simulating physics, nothing will happen if it doesn’t. That is the only thing I can really think of that could be wrong with it without going through it with print strings.

I’m really new and unsure what I’m actually doing. Could you attach some screenshots explaining what I need to do?

That Set Physics Handle Active node that is right after the Right Mouse Button node. Move it to the position before the Grab Component node and connect in sequence. You are setting the handle active before you even know there is a physics object being scanned.

In other words, you have shot your foot with that gun in your hand before the gun had bullets in it.

Ok so I’m guessing I’m making a very stupid mistake or not reading this properly.

c326174d4b33b548bff2c782e300280739a22fb6.png

06c089b8a8b031255547a9b9249da2c7e26855f9.png

Is this what you’re asking? I don’t understand :confused:

Pefect. :smiley: Now when tick checks the bool, it will know that you have a physics handle component to use in the first place.

I’m not exactly sure what could be going wrong in terms of not being able to pick anything up. I checked the wiki tutorial and it looks like you followed it perfectly (although there would be some things that I would change). Try using some PrintStrings on the branches after the false execute pin. If one of them is false, none of the other code will be fired and you will know the condition was right. If they are all true in your case, everything is going as it should, but we need to look else where to find out where it is failing.

How to use this for a third person?=)

PS:Excuse me for my bad English=)

Not a very stupid mistake, just “jumping the gun” on what you want it to do before the game even knows you can do it.

You would not use the camera, but a combination of the ThirdPlayer and the camera for the Line Traces.

All of that just went straight over my head :confused: I know literally nothing about what I’m doing

Print String node. It prints a string to the screen (upper-left corner by default). You attach it to any point in your connections and it will show whatever message you have in the string. Use a bunch of those to find where it is failing, by either seeing or not seeing the message pop up. For example, if you put it right after the Grab Component node, it should show a message on the screen when that piece of the code has executed (activated).

If you place the Print String nodes on just the False ends of the Branches, and a message shows up when you are in the game testing it, then you know where it went False (assuming you put a different message into each of the Print Strings so you could tell them apart).