Timed and Looped UI text shadow offset in Unity 5+
I was checking around the new UI system and got an idea with the guitext shadow effect:
to make the title text in my game:
move in the X axis move back and forth between 0 and an X every Y amount of seconds, kinda reminiscent of the Hotline Miami title screens.
If its possible I'd like it in C#. I'm pretty new to coding so I know what i want to do but no clear idea on how to apply it into code.
Thanks very kindly in advance! And Merry Christmas!
Answer by Positive7 · Dec 24, 2015 at 11:06 PM
Merry Christmas!
using UnityEngine;
using UnityEngine.UI;
public class ShadowTest : MonoBehaviour {
public Shadow _shadow; //assign it in editor
float _start = 0.0f; //Start at
float _end = 3.0f;
void Update()
{
_shadow.effectDistance = new Vector2(Mathf.PingPong(Time.time * 2, _end - _start) + _start, -1);
}
}
Hello! I have returned from xmas break! Thank you for answering and I hope you had a fun night!
I assume this goes in a completely new script attached to the Text object, right?
Thank you for answering!
Your answer

Follow this Question
Related Questions
Score system using prefabs in C# 0 Answers
C# Loop script,C# LOOP SCRIPT HELP NEEDED! 0 Answers
How to make one Character follow behind another character? 0 Answers
Don't know how to access UnityEvent listener 1 Answer
Can't change light colour. 1 Answer