So I was making a raycast. For the position input for the raycast I split A and B and created another Vector3. Everything was the same as A’s position besides the Y being switched out with B’s Y. This was supposed to be for getting a consistent result for the hit position. I then used a random object and a ‘Set Position’ to see what it would look like. It went to the raycast’s start position.
I want to know if simply creating a Vector3 like this gives you a different kind of Vector3. When I say different kind of vector, I mean how directions and positions are in the same format.
Sorry for not getting a better angle to take the picture provided.
1 Like
Splitting a Vector3 doesn’t change it’s “type”. It just depends what inputs you construct your Vector3 create with.
You are using the vector3 split correctly here in the context you provided.
As long as both inputs are giving positional vector3 data, then the output will make sense.
To be clear however, there aren’t really different kinds of Vector3’s. Positions and directions are stored differently in a vector3, for example your world position can be something like: 24.12,13.25,-15.24.
However directions are “normalized”, meaning they stay inside the unit sphere and have a magnitude of 1. An example of a direction would be “0.7667, 0.4212, -0.4845”. The magnitude of a vector is simply it’s length in our 3D space.
Hope this helps!
2 Likes
Thank you for the clarification. Do you have an idea as to why the raycast isn’t working. Did I construct this wrong.
Try flipping the subtraction chip’s inputs, also check if your raycast chip isn’t configured to ignore objects.
1 Like
Flipping the subtraction inputs will only change which way it’s looking, which would be at a from b. I had already tried flipping the inputs anyways, just to see if anything changed. Also, I have it configured the raycast to ignore objects because I need the it to hit the player.
Ah! I know why, I ran into this little hiccup myself before.
Use “get player head position” instead as it’s pointing the directional vector in the raycast the the ground position of the player, which wouldn’t hit anything.
1 Like
Vector3s do not have distinct types; instead, positions and directions are represented differently. A world position can be expressed as (24.12, 13.25, -15.24), while directions are “normalized,” meaning they have a length of 1 and stay within a unit sphere, such as (0.7667, 0.4212, -0.4845). The magnitude of a vector indicates its length in three-dimensional space.
I don’t know why I hadn’t messed with Euler angles sooner. I just realized I can check the rotation in degrees by turning a quaternion into a vector3 because of your comment. I’m so slow. Also ik there are different ways to do this, but I really don’t care to figure them out rn.