Collision check

Good afternoon.
Today I’m making a ladder and I want my character to be able to interact with it without pressing certain buttons if he moves towards the stairs.
I decided that it would be a good idea to make a Line Trace that will check whether the player has collided with a ladder or not.
Apparently I misunderstood something, because the line collides with the stairs, but the inscription does not appear.
What could be the problem?



image
As I understand it, everything should work. If the line touches any part of the ladder, there should be a collision signal. Despite the fact that the ladder is an actor. Probably it doesn’t work that way and it’s easier to do a collision check?

instead of use Hit Actor = “SomeActor” try use Hit Actor → Actor has tag or use a interface :face_in_clouds:

The advice is exhaustive, although I didn’t really understand exactly what to do. I do not know what a Tag is and how to work with it, and the attempt through the interface did not work, I am sure that I did everything wrong. There is not enough knowledge.
If possible, you can give more information on exactly how to do this. Write more intermediate steps between “Use it” and “You’re great.”
Thank you in advance.

I read in the name that it says procedural ladder, it may be that every time it is generated it is creating a new instance of the ladder and causes the check to fail, that is why it would be better to go to the BP of the ladder and add a Tag to the actor and then check if the actor has that Tag, that way it is independent of the instance you use it should always detect it.

here a video about Tag

1 Like

Thanks for the video, I will definitely get acquainted, but the staircase is called procedural, because inside you can adjust its height and all that. That is, no, the ladder is not generated in a new way every time.
But, it may be that if I specify the actor of this ladder and try to interact with the same ladder in the playing field, is this ladder a child actor of the oreginal or is it an oreginal? Probably a stupid question, but I’m interested.
It’s just that if it’s the same actor, why isn’t the hit fixed?
Or are the internal changes of the actor who was put on the field perceived by the engine by a new actor who does not relate to the original in any way?

Hello again. The video you sent is really very useful. Such a simple function as a Tag opens up a lot of possibilities that I will definitely take advantage of.
Using the advice from the video, I managed to call a line when the Line touches the stairs and only it, but not without problems.
Now, after stimulation, an error pops up, the meaning of which I cannot fully understand. English is not my native language, so she puts me into a state of prostration, I can’t catch the meaning of the mistake with the translator.
Message text: Blueprint runtime error: “The object trying to read the CallFunc_BreakHitResult_HitActor property could not be accessed.” BP_CharacterCallFunc_BreakHitResult_HitActor".
I’m asking for more help.

the errors is…the hit result is not valid, u need to put a Branch and connect to the return value of the Linetrace, or after the Hit result connect a “Is valid” node to the hit actor

1 Like

I didn’t fully understand exactly what I should do, but after trying my luck, everything worked. Rather, the system is working, but errors do not come out.
Thank you for your help, I learned a lot thanks to your answers.


It is probably this kind of execution that will lead to errors, but to fix it, I will simply not use a general function, but create it specifically for checking for stairs.

Well, yes, I did everything. Now I have a simple hit function and a hit check with actors with a certain tag.