Line trace help

Hello again, I was wondering if anyone could help me out with a problem I’ve been having recently.

So I have a blueprint that allows for the player character to deal damage to the enemy by jumping on them a la Super Mario that’s works pretty well.

Jump collision blueprint:

Limit box trace direction:

Enemy blueprint:

However, the problem with my setup is that in it’s current state its not ideal for interacting with multiple enemies or other objects, as you can see with the bloated mess below:

So I’ve been trying to streamline my setup using a parent blueprint for all enemies, as well as other changes such as removing the jump collision from each of the individual player characters, in favor of the jump collision being located within the parent blueprint:

Revised jump collision blueprint:

Enemy parent blueprint:
jump_hit_revised

Revised enemy blueprint:

Unfortunately, for some reason the revised setup isn’t working at all. Unlike the old version, the player character doesn’t damage the enemy & bounce off them when they land on their head. Instead nothing happens at all with the player harmlessly passing through the enemy.

Additionally, when I delete the old jump collision code from the player character’s blueprint, I get the following error message after I exit the game.

I assume that is related to the revised jumping collision code not working but I’m not sure how, which is why I need help in identifying the problem.

Any help whatsoever would be greatly appreciated! Thanks in advace!

Is getting called?

image

Did you try a print string here?

The solution for ‘accessed none’ is always the same, click the last link on the right, it will take you to the offending node.

2 Likes

I’m not sure how to tell but I did try putting a print string in and I noticed that jumping on enemies parented to the new enemy parent blueprint doesn’t register a hit. Notably only affects enemies that are parented to the new enemy parent blueprint, as enemies that haven’t been converted over do register a hit.

So the problem seems to be that for whatever the line trace isn’t registering any enemies connected to the parent blueprint.

I’m not sure why that is but I’m guessing its connected to the error message that I’ve been getting.

I tried clicking the last link on the right of the error message like you suggested and it directed me to :

I’m guessing that branch node is the culprit?

The only reference you have there, is the ‘out hit actor’, so you’re running the code, but no actor has been hit.

1 Like

I’m sorry but I’m more artist than engineer so a lot technical stuff tends to go over my head, but why isn’t the line trace recognizing the parented enemies? Is it because the Out Hit on the line trace node needs an actor to be targeted and it’s targeting a interface blueprint which isn’t a actor?

You’ve got the trace on tick. That’s every frame. The trace isn’t finding an object every frame. That’s why you need to check if it actually did hit something. It’s what pin is for

image

Unfortunately, the Out Hit Blocking Hit output isn’t compatible with anything that was previously hooked up to the Out Hit Hit Actor.

Essentially, you need to ensure that you’ve hit something first before attempting to access that Hit Actor. While the interface does not care, the collapsed graph does, here:

image

2 Likes

Okay, that appears to have fixed whatever was causing the error message to appear but the main problem still persists. In fact, I’ve noticed that the print string isn’t appearing anymore, which would indicate that something isn’t hooked up correctly.

Also it just occurred to me that I’m using a box trace not a line trace, so topic should be called ‘Box trace help’ instead.

Assuming is the collapsed graph, what values do you get from Velocity and ACOSd? Also, is it safe to assume Up is where Up normally is? When things rotate, up vector can point anywhere, really.

Apart from that, the script looks fine at a glance - perhaps actor has no movement comp / physics and does not report velocity? Hard to tell.


edit: just noticed the box trace half size Z is 0 - is intended? Never tried to box trace with 0 dimension. Does it even work?! Did you try to visualise the debug to see what / how you’re hitting things as you fall?

Its not the Limit Box Trace Direction that’s causing the problem.

I fixed it following your previous advice but it doesn’t resolve the issue of enemies that have been parented to a master enemy blueprint completing ignoring the player’s box trace.

Heck, I even tried removing the Limit Box Trace Direction event altogether to what see what would happen and absolutely nothing changed at all.

I thought the problem was related to the earlier error messages I was getting before, but appears I was wrong.

The problem is being caused by something else and the only thing I can of as to why is that maybe the box trace doesn’t recognize an interface blueprint message as a viable target. That would explain why enemies that weren’t parented to the master blueprint worked with the box trace but enemy that are parented do not.

There’s something I don’t understand.

How come works:

But doesn’t:

They both seem to be fundamentally similar but only the former one works though. The latter works when its casting to the directly to the enemy blueprint but for some reason doesn’t seem to work with interface blueprints.

Is it unusual that the interface event that I’m trying to implement, “Jump Hit”, is no where in list?

interfaces

I’ve noticed two of the events are ones that I’ve actually got working, while “Jump Hit” which isn’t working is not here on list.

I’m not sure if that’s a coincidence or not but at point I don’t really know what else I can do.

I checked out a tutorial video on implementing line tracing & interfaces, which showed that there’s no issue with using the two in conjunction with one another. So I’m not sure why its not working for me, although the video did use line tracing instead of box tracing. However, I don’t see why using box tracing instead would make that much of a difference.

  • is it in the Default category by any chance?
  • how many different interfaces are we using?
  • how many classes are involved?
  • who in the hierarchy inherits which interface?

If you mean :

Then no its not in there, just Baseball Bat Hit, Tail Hit, Null Damage. I created a number of other interface functions but the three I listed are the only ones that appear in the Default list.

Do you mean in the entirety of my project or just the jump collision? In both cases the answer is the same, only one. So far I only have interface blueprint, the damage interface, and in the case of the jump collision, it’s only using the ‘Jump Hit’ interface function.

I don’t know anything about either of these, nor do I know how to look up that information.

Can you show the interface functions? All of of them? In the interface itself. And actor’s class defaults settings, where the interface is implemented.

What do you mean, you have parent calls in your examples - you surely must know which class you added the interface to and how many classes you’ve created.

You mean ?

image

Then no its not in there, just Baseball Bat Hit, Tail Hit, Null Damage. I created a number of other interface functions but the three I listed are the only ones that appear in the Default list.

So what do we have if you expand Default here?


Can we also see:

And actor’s class defaultssettings, where the interface is implemented.

Okay, so I found Jump Hit in the Default list:

interface_defaults

As for the actor class defaults, I didn’t know which specific actor that uses the interface you’re referring to, so I included all of the ones that incorporate the Jump Hit function.

Character master class defaults settings:

Enemy base class defaults settings:

Enemy class defaults settings: