I’m trying to make a script for a spatula that picks up an object. When the spatula has nothing on it, it is held in an upright position (like a sword). However, when a spatula picks up an object, it shifts its rotation to tilt downward to hold the object.
It is able to pick up objects fine, but the spatula will not rotate no matter what I do. Here’s what the script looks like:
local spatula = script.Parent
local handle = spatula.Handle
if script.Parent.Head:FindFirstChildOfClass("Part") ~= nil then
print("Picked up object")
spatula.Grip *= CFrame.fromOrientation(math.rad(15), math.rad(-90), 0)
end
For some odd reason, it doesn’t even fire the print statement, even though a Part is placed in the parent directory (which satisfies the conditions needed to occur).
Here’s what it normally looks like when I try to do it + its orientation details (incorrect):
And here’s what it should look like (after editing the orientation via Properties):
I know for a fact I’m missing something, but I can’t seem to put my finger on it. I’ve looked through numerous guides, but they’ve only been for things like changing the regular grip (permanently) or animations that only change it temporarily; not something that can be switched on and off. What can I do to get this working?