Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this always output 0, 0, 0? I've already described it, why do I need more?

Asked by 3 years ago
Edited 3 years ago

I'm making a convertor for positions for ripping a 3d model from another game. The positions work fine, but the orientation always prints 0, 0, 0. Why is that?

The code is based off of this: link (go to line 77)

local XNode = Vector3.new(-0.850637, -1.70512, 1.27218)
local YNode = Vector3.new(0.600007, -2.03402, 1.28813)
local RefNode = Vector3.new(-0.850637, -2.03402, 1.27218)
local OffsetX = 0.5
local OffsetY = 0
local OffzetZ = 0

local diffX = XNode-RefNode
local diffY = YNode-RefNode

local normal = diffY:Cross(diffX).Unit
local position = RefNode + OffsetX * diffX + OffsetY * diffY
position = position + OffzetZ * normal
print("Position of the flexbody/prop is " .. tostring(position))

local rot = Vector3.new(0.5,0,0)

local refX = diffX.Unit
local refY = refX:Cross(normal)
local orientation = Vector3.new(refX, normal, refY) * rot

print("Orientation of the flexbody/prop is " .. tostring(orientation))
0
is the orientation actually 0,0,0 (as in, the part itself is in the correct rotation as where you are taking it from) but just it prints 0,0,0? FirewolfYT_751 223 — 3y
0
I’ve tried other rotations but it always prints 0, 0, 0. Check the rot variable. It’s not the exact rotation but the formula is under it to convert it to an actual rotation. Also check the code it’s based off of. squidiskool 208 — 3y
0
, I’ve might’ve gotten something wrong while translating it to LUA. squidiskool 208 — 3y

Answer this question