I would like to know how to create the effect which is in the temple run game in whihc when the coins are collected, the coins flies towards the coin meter. Is it just using a texture or using a 3d model for this purpose? Can some one please help me out? In my game, which is an infinite runner type game, the player collects coins and it is showing in the coin meter. But I want to show that the coins collected are moving to the coin meter to the player. How can it be shown? Some one please guide me regarding this topic. Thanks in advance.
The easiest way to do it, is to calculate the point of your coin meter label in world space by using Camera.ScreenToWorldPoint. Then you can animate you coin for example by rotating it around its Y axis and at the same time scaling it down to appropriate size and moving it towards that calculated point.
Make a coin-shaped cylinder and attach this script to it:
using UnityEngine;
using System.Collections;
public class flyToMeter : MonoBehaviour {
public GameObject meter;
void Update () {
transform.position = Vector3.Lerp(transform.position, meter.transform.position, 1.5f * Time.deltaTime);
}
}
Then, in your scene, make a cube, or empty game object and position it roughly where the meter is and then set that as the “meter” in the coin’s inspector. Press play, the coin will fly to the meter.
Hope this will help, I think this is the exact thing you are asking for: Unity | Coin collection system with Coin collecting Animation - YouTube