Could someone help me?

Hello, So here it is, I have a bug and I found the solution but I need someone to show it to me because I can’t figure out how to do it verbally so here is the solution added on my BluePrint which is just below :

You can solve this problem by modifying two branch instructions to receive an OR condition. The first branch that needs it is the one immediately following the first “LineTraceByChannel”, add the boolean variable “inspecting ?”, as well as an OR condition, then branch the inspecting variable and the already existing return value of our LineTrace into the OR conditions that can then return to the branch. Then repeat this process with the next branch statement, which currently only takes the value “ActorHasTag” as a condition. So, in summary, for those interested, the mechanic will now work if the object in front of it is an object to inspect, OR if it is already holding an object.

This is the BluePrint:

Do you have a question? This is not clear.

I wouldn’t try and mix inspection and the line trace, because they are separate functions.

Either you are already inspecting something OR you can do a line trace, and pick it up…

thank you for your answer and it is true that I may not have been clear enough. To tell you the truth I watched this tutorial: Picking Up And Moving Objects | Inspect Item Part 1 - Unreal Engine 4 Tutorial - YouTube
to make an object inspector system. But when I finished there was a bug and this bug is that of not being able to drop the object after taking it. Then I saw the comments of the video and apparently several people had the same bug as me and one person then gave the solution (the one I put above) to solve this problem but I don’t know how to do it.

Here is an example of my bug in video:

Ah…

If you’re inspecting, there’s no point in the line trace, so you need something like this

2 Likes

just this without a follow-up? in any case thank you very much for your help it is very kind

The follow up, is you telling me if it works or not… :slight_smile:

so I did everything but two things. Sorry I’m a bit of a beginner and I don’t know how you got the DROP and the PICKUP

I was assuming, because you followed the tutorial, you had written code to pick up the object and drop it again?

I just called then ‘drop’ and ‘pickup’ so you knew what I meant.

yes I watched the tutorial to pick up and drop off again

Yes, so just put calls to your pickup and drop stuff there.

I’m really sorry, I don’t understand. I’ll try to find out what you’re telling me, but thank you very much for your help.

I see from your video picking up works, right?

To take the object yes but to deposit it no

What is your custom event called to pickup an object?

Hmmm, I just took a look at the tutorial, it’s a bit of a mess, there is no pickup custom event…

oh ok so is it still possible to repair?

Sorry, I don’t have time to follow the whole thing. His code is a little spaghetti based.

Do you see others having the same problem?

yes and wait I will send you one of the solutions that someone said

So here is one of the solutions reported in the comments of the video:

I realize this is super late but, this is a feature for the script as it was written and not a bug. You can fix this however by setting the first two branches after the first LineTrace to accepting an OR condition, with the other condition being “inspectable?”. So if inspectable is true(player is holding) then it won’t require the linetrace hit.