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

Is adding two vectors in roblox the same as in unity?

Asked by 6 years ago

Tryna make an inverse kinematics thing by translating unity stuff into roblox.

0
Can you explain that better? cailir 284 — 6y
0
Its better to use CFrames, it would be the same way as vectors though (nearly) except you multiply cframes (do not add) so lets say p.CFrame = CFrame.new(1, 2, 3) * CFrame.new(4, 5, 6) abnotaddable 920 — 6y
0
so its the same effect? brickmaster2039 2 — 6y

2 answers

Log in to vote
1
Answered by 6 years ago
Vector3.new(1,1,1) + Vector3.new(1,1,0) = Vector3.new(2,2,1)

Vector3.new(1,1,1) + Vector2.new(1,5) = ! ERROR: incompatible types !

CFrame.new(1,1,1) + CFrame.new(1,1,1) = ! ERROR: no !

CFrame.new(1,1,1) + Vector3.new(1,1,1) = CFrame.new(2,2,2,0,0,0,0)

list of more possible operations using coordinate frames: http://wiki.roblox.com/index.php/CFrame#Operators

list of more possible operations using vector3s: http://wiki.roblox.com/index.php?title=API:Vector3#Operators

good to know that when using vector3s, or CFrames, roblox measures in "studs", so 1 stud^3 would be a full block

and the annoying part about vector3s is that setting a parts position, "Orientation", or size, it has built in collision detection, so teleporting a part inside of another part is way different from using Part.Position than Part.CFrame

Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

The simple answer is no. Roblox and Unity are two completely different engines of code, and Roblox is mostly pixelated, compared to a smooth Unity. Plus, they are two completely different dialects of Lua. Some of the code in Unity cannot be transferred to Roblox Lua or else it'll get errored out. Therefore, you cannot transport Unity code to Roblox.

0
I know it's two years later and all, but did you think he actually wanted to copy code from Unity and paste it into Studio? MasterBenedict 0 — 4y

Answer this question