How would I make a color sequence in a trail using instance.new?

  1. What do you want to achieve? I want to make a player get a trail with a touched event that has a color sequence

  2. What is the issue? I have the trail but I can not get the sequence
    image

  3. What solutions have you tried so far? I have tried using vector3, to no result.





	

      
	script.Parent.Touched:Connect(function(plr)
	
			
	local trail = Instance.new("Trail")
	trail.Parent = plr.Parent.UpperTorso
	local attachOne = Instance.new("Attachment")
	attachOne.Name = "A1"
	attachOne.Parent = plr.Parent.UpperTorso
	local attachTwo = Instance.new("Attachment")
	attachTwo.Name = "A2"
	attachTwo.Parent = plr.Parent.UpperTorso
	trail.Attachment0 = attachOne
	trail.Attachment1 = attachTwo
	attachOne.Position = Vector3.new(-1.5, .5, 1)
	attachTwo.Position = Vector3.new(1, 1, 1)
	
	trail.FaceCamera = true
	trail.LightEmission = 0
	trail.LightInfluence = 1
	
	trail.Lifetime = 1
	trail.MaxLength = 10
	
	
		
		
	
	
end)

Help would be apreciated! :slight_smile:

Use colorsequence to make a trail with a color sequence. EX:

--rainbow
local trail = Instance.new("Trail")
trail.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 0, 0)), ColorSequenceKeypoint.new(0.145, Color3.fromRGB(255, 127, 0)), ColorSequenceKeypoint.new(0.311, Color3.fromRGB(255, 255, 0)), ColorSequenceKeypoint.new(0.434, Color3.fromRGB(0, 255, 0)), ColorSequenceKeypoint.new(0.582, Color3.fromRGB(0, 255, 255)), ColorSequenceKeypoint.new(0.719, Color3.fromRGB(0, 0, 255)), ColorSequenceKeypoint.new(0.862, Color3.fromRGB(75, 0, 130)), ColorSequenceKeypoint.new(1, Color3.fromRGB(143, 0, 255))})
2 Likes

Thank you!

thats was really helpful

You should mark @Kaid3n22’s post as the Solution so others don’t try to solve it as well. If someone is searching for the same answer then posting this as Solved will help them too.

how do you mark as a solution?

That was lagit my 1st post sorry

1 Like

Change the category to scripting support as it will get flagged. You can’t mark the solution because of the category. Once you change it, it will show a check mark and you mark it from the reply.

alright I just moved it thanks

1 Like

I am always gonna be here to help! :grinning_face_with_smiling_eyes:

1 Like