How would i tween lookvector for my knockback?

You can write your topic however you want, but you need to answer these questions:

  1. how do i make this lookvector tween

  2. i dont know how

  3. i have tried looking on the dev forum and tweening the cframe to the lookvector property but it doesnt work

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

You can just do:

local goals = {}
goals.CFrame = CFrame.lookAt() -- put cframe stuff here

And then apply those goals to the Tween.

1 Like

thats a bit confusing…can i get a bit more info on this?

if CanKnockback == true then
		local goals = {
			Spectris.HumanoidRootPart.CFrame + Spectris.HumanoidRootPart.CFrame.LookVector * -KnockbackDamage
		}
		
		local Tween = TweenService:Create(Spectris.HumanoidRootPart, TweenInfo.new(.25, Enum.EasingStyle.Sine), {goals})
	end

it says it cant cast to dictionary

Use this instead:

if CanKnockback == true then
		local goals = {
			CFrame = Spectris.HumanoidRootPart.CFrame + Spectris.HumanoidRootPart.CFrame.LookVector * -KnockbackDamage
		}
		
		local Tween = TweenService:Create(Spectris.HumanoidRootPart, TweenInfo.new(.25, Enum.EasingStyle.Sine), goals)
	end

it works! thank u so much : ) really needed this

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.