Bad localisation of line

Hi,

i have completely no idea where the problem can be. Red line appears under the floor. Code should be ok.
Any ideas?



Hey!
This might actually be really too late but well, since I just read it let’s answer it!

My guess is that it’s because of lines 37 to 40 that are commented while they shouldn’t be.
Being commented, your PlayerViewPointLocation and PlayerViewPointRotation variables don’t have the values you expect.

You declared them by typing:
FRotator PlayerViewPointRotation;
FVector PlayerViewPointLocation;

But you didn’t initialised them (give them a value), which is done by those lines:
GetWorld()->GetFirstPlayerController()->GetPlayerViewPoint(
OUT PlayerViewPointLocation,
OUT PlayerViewPointRotation
);

That’s why you don’t find your red beam where you expect it to be!

(Then why is it under your floor? Well not sure but I think that when you don’t initialised your variables (set a value for each variable), they have a “random value” corresponding to a number that already existed in the memory… memory stuff :laughing: )

Hope you found your answer (well I’m pretty sure you did a month ago now xD)

Yes I did but thank you anyway xd

1 Like

Privacy & Terms