Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

3 comments

0

Can you explain that better?

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)

0

so its the same effect?

2 answers

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

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.

1 comment

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?

This discussion is preserved as it was. New answers, comments, and votes are closed.