Hello.
I am making a flight simulator and I am making controls for mobile using gyroscope. The output from gyroscope is a CFrame. How do I put a CFrame into Vector3? When I am trying to do so, everything is 0.
Hello.
I am making a flight simulator and I am making controls for mobile using gyroscope. The output from gyroscope is a CFrame. How do I put a CFrame into Vector3? When I am trying to do so, everything is 0.
a CFrame consists of 2 vectors, for example;
CFrame.new(Vector3.new(0,0,0), Vector3.new(0,0,0))
the first vector determines the part's position and the second vector determines the part's orientation(where the part faces). To get a CFrame's position roblox has a neat function where you can type ".p" after a CFrame to get its position; for example,
CFrame.new(Vector3.new(0,0,0), Vector3.new(0,0,0)).p
this should give you the position; hope i helped.
Use Position instead, and your example is merely a constructor.
that doesnt change the fact that its a example.
also people like to use .p cus its easier to type.
not to mention this is just a casual discussion
anything else you would like to point out? im open for rational improvement
when i use .p all values in vector3 are 0, btw i figured out how to do it: lookVector :)
"It's easier to type" argument is a bad argument
@NsNidPL congrats
@sjr04Alt as long as it is an arguement
i used lookvector and it works
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
A CFrame contains a Vector3. You can use someCFrame.p to get the Vector3.
then the vector3 is 0, 0, 0