Since it is a button though, the model just keeps rotating as the event keeps firing. I tried orientation but that did not quite work out. How can I just set it to a certain position when this button is touched?
That is how CFrame works I guess, but I just want to change its orientation once and that’s it. Like it’s orientation will be (1,0,90) and I want its orientation to be (30,0,70) instead
The event fires every single time the block is touched. It is a regen button. I just want to change it’s orientation. I can’t use CFrame and when I used orientation I got errors. Looking for a way to change the whole models orientation.
Every time you rotate the model, you’re referencing the original position with
:GetPivot()
But… That alters the last rotation set, not set it to a specific rotation.
To set a specific rotation, you wouldn’t account for the current rotation, unless a certain axis is supposed to stay the same or align with something else.
local debounce = false
local it = v.PurchasedObjects.Up
it.PrimaryPart = it.Body
if not debounce then
debounce = true -- makes it so it can only run ONCE
it.PrimaryPart.CFrame = it.PrimaryPart.CFrame*CFrame.Angles(math.rad(xro), math.rad(yro), math.rad(zro))
end
-- if you want to be able to run the event again at any point in time, use debounce = false
orientation doesn’t work because only CFrames that are altered on the primarypart of the model replicate to the rest of the model parts