Degress To Vector3 [SOLVED]

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

Hi good days or nights

i wan’t to create a function To Convert A Number To Vector3

Explanation:

function Degress(deg1,deg2)
      -- Some Things
end

print(Degress(0)) -- returns 1,0,0

print(Degress(90)) -- returns 0,0,1

print(Degress(45)) -- returns 0.5,0,0.5

print(Degress(0,90)) -- returns 0,1,0

  1. What is the issue? Include screenshots / videos if possible!

i no know how to made that

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

yes

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

You could probably just do something like:

function Degrees(deg1,deg2)
    return CFrame.Angles(math.rad(deg2),math.rad(deg1),0).LookVector
end

ok thanks i go try that thanks :wink:

1 Like

only have a small error but only it’s negative the number returns

here is the correctly code

Code:

function Degress(deg1,deg2)
	if not deg1 then
		deg1 = 0
	end
	if not deg2 then
		deg2 = 0
	end
	return -CFrame.Angles(math.rad(deg2),math.rad(deg1),0).LookVector
end
1 Like