I am drawing a debug line to see the shoot direction and so on…
But the thing is that I can not get why should I specify Rotation to the UGameplayStatics::SpawnEmitterAtLocation function…
So the Hit.ImpactNormal should return the opposite normalized vector of shooting, isn’t it?
What could go wrong if I specify FRotator(0,0,0) instead of Hit.ImpactNormal.Rotation()?
I will not be able to get the ImpactDirection from an actor or a pawn, which I would hit or what?
Hit.ImpactNormal.Rotation() returns the
Hit.ImpactNormal description:
Image how I understood it. The red Line is a normalized vector pointing out from the plane
[SPOILER]
https://snipboard.io/xIgqQa.jpg
[/SPOILER]
Who can explain me please the meaning of normalized vector in this situation and other in much details as it would be possible for you!
How does it transform the normalized vector into rotation?
I strongly advise you to use blueprints before jumping to c++ because such questions should be tested and understood by yourself and using blueprints you can play around safely with everything
This is normal. It perpendicular to the plane it points out.
Vector to Rotator conversion is done by using vector direction to determine pitch and yaw while roll will be zeroed because Up vector wasn’t specified
look for Vector -> Rotator conversions in KismetMathLibrary
I tested this one and the Hit.ImpactNormal.Vector(); and There was no difference in what I could see visually.
Thanks, Yeah, I do use BPs.
What the use of the normalized vector, I can not understand where I can use the normal vector which has length one (a unit vector)?
Could you please give me some real examples? and what does it mean normal vector which length is equal to one? So what is it for and how can I imagine it in a game?
Yeah, I use VisualAssist for it and using ALT+G I can go to the function definition and read about it, but that not always helpful to start from, especially if you see it at first.
A unit vector is a very convenient way to describe the direction and some operations require unit vector to work properly.
Atan2 is thing that gives the angle using two sides of right triangle.
And now, if you don’t want to stumble in the dark go to the Youtube/Wiki and learn Vector Algebra and Trigonometry
Do you mean that if my actor/pawn has the forward vector set to +Z(axis)? I can use it to get the rotation to a point I aimed for? and the same for +X(axis), right?