Advertisement

Calculate the character's destination based on projectile's location in UE 4.26

Started by February 11, 2022 11:53 AM
10 comments, last by Thaumaturge 2 years ago

It's been a bit since my last post.

I've been definitely discouraged by the amount of math I keep struggling with, then work and life in general didn't help but were lazyness and being out of my comfort zone what really kept me away of my project.

To be honest a few weeks after my last post I came to know of a specific blueprint node that just does the job, it's called “Line Plane Intersection”, you basically input both a start and end point (vector's) and an origin and normal for the plane then it just outputs the intersection coordinates and another couple of values. I know it's a lame way to do stuff but in my case it really helped.

I just fed the output coordinates to the character and that's it! Now he happily moves to the point of intersection.

The "code" needs to be refined in a sense that the character moves only if there's an intersection and not there's none, IE: the projectile is going to bounce off a wall first.

So I should, as soon as the projectile is fired, calculate the trajectory after the bounce, if there's any at all, and use that instead.

I'd like to thank you again Thaumaturge for pointing me in the right direction.

Jvdicator said:
I know it's a lame way to do stuff …

Nonsense! It's the use of a tool, the application of a previously-solved problem to simplify the current problem.

After all, if we always required ourselves to solve things from first principles, then we'd likely not have most of the technology that we do have, I daresay. If you want to dig a hole, is it important that you first be able to construct your own spade?

Anyway, I'm glad that you found this tool, and that it seems to have helped! ^_^

Jvdicator said:
I'd like to thank you again Thaumaturge for pointing me in the right direction.

It's my pleasure. ^_^

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

This topic is closed to new replies.

Advertisement