Skip to content

Code 3 Interactive

Craft Apps & Games

  • Home
  • Tech News
  • Unity Tutorials
  • YouTube Channel
    • Mobile Apps
    • Online Course
    • Follow Us On
    • Contact Us
    • Patreon
    • Privacy Policy
  • Home
  • Unity Tutorials
  • Script that detects if the player has fallen off the edge of a platform and respawns them back to the start.
Unity Tutorials

Script that detects if the player has fallen off the edge of a platform and respawns them back to the start.

February 12, 2023February 12, 2023 Technology Researcher
using UnityEngine;

public class PlayerRespawn : MonoBehaviour
{
    public Transform startPosition;
    
    private void Update()
    {
        if (transform.position.y < -10f)
        {
            transform.position = startPosition.position;
        }
    }
}
Technology Researcher

Analyst studies emerging trends in the information technology.

Related Posts

Unity Tutorials

Create a script that moves a GameObject forward in the direction it is facing.

April 28, 2023February 12, 2023 Technology Researcher
Unity Tutorials

Script that rotates a GameObject around a specific axis by a certain amount each frame.

April 21, 2023February 12, 2023 Technology Researcher

Post navigation

Previous: 50 Must-Know Unity Interview Questions with Answers for Beginners
Next: Script that adds a projectile to the scene when the player presses the spacebar, and launches it in the direction the player is facing.

Leave a Reply Cancel reply

You must be logged in to post a comment.

Support Developer

Donate

  • Donate withBitcoin
  • Donate Bitcoin to this address

    Scan to Donate Bitcoin to 19wTsPAw3joThSfF9m1sRGC9CfqpG9zkj9
    Tag/Note:- Minimum deposit 0.00000001 BTC Send only BTC to this deposit address. Ensure the network is BTC.
  • Donate withEthereum
  • Donate Ethereum to this address

    Scan to Donate Ethereum to 0x68ea21f63a7a47ad1d07ccce1e19d3e8931a5472
    Tag/Note:- Send only ETH to this deposit address. Ensure the network is ERC20.
  • Donate withXrp
  • Donate Xrp to this address

    Scan to Donate Xrp to rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh
    Tag/Note:- Memo ID: 105074699 Entering MEMO is required. Ensure the network is XRP. to send XRP else coin will not reach.
  • Donate withDogecoin
  • Donate Dogecoin to this address

    Scan to Donate Dogecoin to DLVw2DufgnsevAvnyNEJTxNPTr2ffbg12a
    Tag/Note:- Send only DOGE to this deposit address. Ensure the network is dogecoin.

Receive email updates when new articles are posted

Loading

All Rights Reserved 2022.
Proudly powered by WordPress | Theme: Fairy by Candid Themes.
en English
ur Urduhi Hindien Englishzh-CN Chinese (Simplified)pa Punjabide Germanes Spanishnl Dutchru Russianpt Portuguesefr Frenchit Italian