Trying to make a little “uptilt” func when called. For a move
Current code:
function Hitbox:ApplyUptilt(choice, speed, degree)
if choice == true then
local forceMagnitude = speed
local angle = math.rad(degree)
local forceX = forceMagnitude * math.cos(angle)
local forceY = forceMagnitude * math.sin(angle)
local humanoidRootPart = self.Target
if humanoidRootPart then
humanoidRootPart.Velocity = Vector3.new(forceX, forceY, 0)
else
warn("HumanoidRootPart not found in entity")
end
end
end
Note: self.Target is the enemy HumanoidRootPart.
called from serverscript:
hitboxInstance:ApplyUptilt(true,15,45)
How it currently looks:
https://gyazo.com/c72afb9dd9954155defc0e85e683cc21
How I want it to look