How do i make a part tween in the direction that im looking at

Im trying to make a really simple kamehameha wave tool and i currently have it spawning a cylinder when i activate the tool but i want the cylinder to go forward wherever im facing, i want to tween the size to make it go forward

image

Im stumped

1 Like

Tween the CFrame, with HumanoidRootPart.LookVector.

1 Like

Can you give me an example? Thanks

Depends, where is the Ball/Cylinder located?

the Ball is the handle for the tool, and the cylinder spawns when i left click
image
I want to do this but it works in any direction

Script currently?

	if canfire == true then
	canfire = false
		wave = Instance.new("Part", workspace)
		wave.CanCollide = false
	wave.Shape = Enum.PartType.Cylinder
		wave.Size = Vector3.new(4,1,1)
		wave.Material = Enum.Material.Neon
		wave.BrickColor = BrickColor.new("Toothpaste")
	wave.Position = handle.Position
	wave.Anchored = true
		player.Humanoid.WalkSpeed = 0
		player.Humanoid.JumpPower = 0
		tweenservice:Create(wave,tweeninfo,{Size=wave.Size+Vector3.new(40,0,0),CFrame=wave.CFrame*CFrame.new(40/2,0,0)}):Play()
	end
end)
what i have rn

tweenservice:Create(wave,tweeninfo,{Size=wave.Size+Vector3.new(40,0,0),CFrame=wave.CFrame*CFrame.new(40/2,0,0)*player.HumanoidRootPart.LookVector}):Play()

Also, why player.Humanoid and not player.Character.Humanoid?

i made a variable for player.Character which is player

Best to define that as character, but I’ll edit my script for now.

player = tool.Parent.Parent.Character

I tried that in studio and it didnt work, “LookVector is not a valid member of HumanoidRootPart”

HumanoidRootPart.CFrame.LookVector.

CFrames are the ones with a LookVector not parts

TweenService:Create property named ‘CFrame’ cannot be tweened due to type mismatch (property is a ‘CoordinateFrame’, but given type is ‘Vector3’) - Server - Wave Code:21

you have to tween position not cframe, lookvector is a Vector3

also you have to multiply it by the number of studs you want it to be:

CFrame.LookVector * 100 --Studs–

now its just a travelling blast that only works when im looking at the X axis?

are you trying to make tha blast fly torwards the direction your camera is looking, your character’s direction or your mouse’s direction?

I want to make it go where my character is looking but I do not want it to fly, look at my second picture above to see what i want.

try using a beam instead of a cylinder and tweening the beam’s attachment 1 to your character’s head lookvector