Skip to content

Conversation

prathmeshbhosle1617-ops
Copy link

using UnityEngine;
using UnityEngine.UI;

public class GiftFall : MonoBehaviour
{
public float fallSpeed = 2.0f;
public GameObject sparkleEffect;
public Text messageText;

private bool hasLanded = false;

void Start()
{
    messageText.text = "Raksha Bandhan Gift Coming...";
}

void Update()
{
    if (!hasLanded)
    {
        transform.position += Vector3.down * fallSpeed * Time.deltaTime;

        if (transform.position.y <= 0.5f)
        {
            hasLanded = true;
            Instantiate(sparkleEffect, transform.position, Quaternion.identity);
            messageText.text = "Gift Arrived! 💝";
        }
    }
}

}

using UnityEngine;
using UnityEngine.UI;

public class GiftFall : MonoBehaviour
{
    public float fallSpeed = 2.0f;
    public GameObject sparkleEffect;
    public Text messageText;

    private bool hasLanded = false;

    void Start()
    {
        messageText.text = "Raksha Bandhan Gift Coming...";
    }

    void Update()
    {
        if (!hasLanded)
        {
            transform.position += Vector3.down * fallSpeed * Time.deltaTime;

            if (transform.position.y <= 0.5f)
            {
                hasLanded = true;
                Instantiate(sparkleEffect, transform.position, Quaternion.identity);
                messageText.text = "Gift Arrived! 💝";
            }
        }
    }
}
@qingshu
Copy link

qingshu commented Aug 2, 2025 via email

@prathmeshbhosle1617-ops
Copy link
Author

prathmeshbhosle1617-ops commented Aug 2, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants