Is it possible, or could roblox implement a way to use ^ on datatypes like Vector2, Vector3, Colo3, UDim, CFrame, etc… I can’t seem to do it in studio using:
Is it possible to make the roblox version work like the luam one?
(or if some admin is reading this, maybe the roblox dev team could add it? Its just a small thing but its good to have.)
You could just create a function to do it for you…
local function powercframes(cframe, power)
local res = cframe
for i = 1, power do
res *= cframe
end
return res
end
Oddly, you can multiply CFrames but you can’t perform powers on them, which is sort of strange.
p.s. I probably made a stupid mistake in my code somewhere - please let me know!
ok im back (what i was doing didn’t take long at all, strangely…)
anyways, here’s a different method
local function powercframes(cframe, power)
local xval = cframe.X ^ power
local yval = cframe.Y ^ power
local zval = cframe.Z ^ power
return CFrame.new(xval, yval, zval)
end
print(CFrame.new(2,2,2))
print(powercframes(CFrame.new(2,2,2), 4))
@Malte0621 i think it works now. im half asleep so i might’ve made another stupid mistake