How could I make the player flash white?

I’m making a combat system for my game, and most of it is done. I have different effects that happen when you get hit etc. I want to have the player flash white to indicate iframes as shown in the video:


I’m not really sure how to go about this. If anyone could help I would appreciate it!

im pretty sure you could just use these Highlight | Documentation - Roblox Creator Hub

As the person above mentioned, you would make use of a highlight!

To achieve the effect, set the FillColor to pure white ([255,255,255]), then use a tween to move the fill transparency from 1 to 0, then back to 1. I believe this will achieve the desired effect!

(I’ll write up a bit of code RQ to demonstrate this)

I did it via a slightly different implementation than I originally intended, but here is the code I used and the resultant effect

local Character = script.Parent -- CHANGE THIS
	local Highlight = Instance.new("Highlight")
	local TweenService = game:GetService("TweenService")
	Highlight.FillColor = Color3.fromRGB(255, 255, 255)
	Highlight.FillTransparency  = 0
	Highlight.OutlineTransparency = 0
	Highlight.Parent = Character
	local Tween = TweenService:Create(
		Highlight, 
		TweenInfo.new(.75),-- Change this to control how long it fades out for
		{FillTransparency = 1, OutlineTransparency = 1})
	Tween:Play()	

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