Align orientation only in 2 directons

I am trying to make a frisbee that is able to spin like a frisbee but does not go crazy when it hits a wall as seen in the video. Right now I am using align orientation and it solves the problem of it bouncing when it hits a wall but now I am unable to make it spin.

You could try this:

local Players = game:GetService("Players")
local Player = Players.LocalPlayer or Players.PlayerAdded:Wait()
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

Tool.Activated:Connect(function()

Puck.Anchored = true
Puck.Position = Vector3.new(HumanoidRootPart.Position.X, HumanoidRootPart.Position.Y, HumanoidRootPart.Position.Z - 5)

repeat

task.wait()

Puck.Rotation = Vector3.new(Puck.Rotation.X, Puck.Rotation.Y + 5, Puck.Rotation.Z)
Puck.Position = Vector3.new(HumanoidRootPart.Position.X, HumanoidRootPart.Position.Y, HumanoidRootPart.Position.Z + 5)

until (Puck.Position -  HumanoidRootPart.Position).Magnitude <= 1

repeat

task.wait()

Puck.Rotation = Vector3.new(Puck.Rotation.X, Puck.Rotation.Y - 5, Puck.Rotation.Z)
Puck.Position = Vector3.new(HumanoidRootPart.Position.X, HumanoidRootPart.Position.Y, HumanoidRootPart.Position.Z - 5)

until (HumanoidRootPart.Position -  Puck.Position).Magnitude <= 1

end)

Sorry for the late reply, what you want to do is have 2 alignorientation and turn on PrimaryAxisOnly.
Make sure the attachments are different to whatever axis you want.

If there’s a better way correct me but this should work.