Hi i was just wondering if anyone knows how i can make text move in things such as signs in game
eg:
Only the text will be in a more scifi/futuristic style:


Would this be projectors,just use a gif, animations etc
Hi i was just wondering if anyone knows how i can make text move in things such as signs in game
eg:
Only the text will be in a more scifi/futuristic style:


Would this be projectors,just use a gif, animations etc
Several methods.
Easiest is probably to use UV animation - you could have a scrolling marquee just by applying a constant change to U or V, or a scrolling animated marquee by using A Lot Of Math to get both position and ‘sprite frame’ to the right spot.
Here’s an animated sprite class I enhanced after snagging it from I think the wiki?
It doesn’t do marquee-ing, but it works well for simple shapes like in your images (rectangles).
var uvAnimationTileX = 2; // Columns in the sprite sheet
var uvAnimationTileY = 1; // Rows in the sheet
var framesPerSecond = 20.0;
var initialFrame : int = 0;
var playOnce : boolean = false;
var beginRandomFrame : boolean = false;
private var maxIndex : int = 1;
private var minIndex : int = 0;
private var size : Vector2;
private var startTime : float;
private var material : Material;
function Reset() {
minIndex = 0;
maxIndex = uvAnimationTileX * uvAnimationTileY;
size = Vector2 (1.0 / uvAnimationTileX, 1.0 / uvAnimationTileY);
startTime = Time.time;
renderer.sharedMaterial.SetTextureScale ("_MainTex", size);
}
function OnEnable() {
material = renderer.material;
Reset();
if ( beginRandomFrame ) Frame( Random.Range(minIndex,maxIndex) ); else Frame(initialFrame);
Run();
}
function Run() {
while ( gameObject.active ) {
if ( framesPerSecond > 0 ) {
var index : int = (Time.time-startTime) * framesPerSecond;
Frame(index);
}
yield;
}
}
function SetRange( min : int, max : int ) {
Reset();
minIndex = min;
maxIndex = max-min+1;
}
function Frame(index : int) {
if ( playOnce index >= maxIndex ) {
gameObject.active = false;
} else {
index = minIndex + index % (maxIndex);
var uIndex = index % uvAnimationTileX;
var vIndex = index / uvAnimationTileX;
var offset = Vector2 (uIndex * size.x, 1.0 - size.y - vIndex * size.y);
material.SetTextureOffset ("_MainTex", offset);
}
}