How to Make Unity Cheat Codes? And Why?

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.ค. 2024
  • Cheat codes! Why? They can be very helpful when testing new functions and features. Got a new mechanic or function to test? A cheat code can speed up your design process. How? This video will look at creating Unity cheat codes with C#.
    Blog Post: onewheelstudio.com/blog/2020/...
    Project Files: github.com/onewheelstudio/Pro...
    Become A Channel Member: / @onewheelstudio
    My video and streaming kit: kit.co/onewheelstudio/tutoria...
    Timecodes
    Intro 0:00
    Why cheat codes 0:17
    Is it hard? 1:11
    Cheat Code Instance 1:46
    Cheat Code Manager 2:08
    Implementation 5:40
    Outtakes 6:13
    Discord: discord.onewheelstudio.com
    Patreon: / onewheelstudio
    Twitter: / onewheelstudio
    Devlog: onewheelstudio.com/
    Twitch: / onewheelstudio
    #UnityTutorial #GameDevelopment #csharp #cheatcode
  • ภาพยนตร์และแอนิเมชัน

ความคิดเห็น • 21

  • @akioasakura3624
    @akioasakura3624 5 หลายเดือนก่อน

    Woohoo. Why only 8k views!? Thank u for uploading sir ur a pro 🙏🙏🔥🔥

  • @theoriginaljosh4515
    @theoriginaljosh4515 3 ปีที่แล้ว +2

    How does this not have more likes and views, its the best video to show you how to implement cheats into your game yet, all the others are from like 4 years ago, still using javascript

    • @OneWheelStudio
      @OneWheelStudio  3 ปีที่แล้ว

      Spread the word! ;) Thanks for the kind words!

  • @erz3030
    @erz3030 4 ปีที่แล้ว +1

    Thanks for sharing this :) Keep up the excellent tutorials!

  • @ozgurgurbuz
    @ozgurgurbuz 3 ปีที่แล้ว +1

    You saved a big amount of my time. Thank you sir!

  • @blue_lobster_
    @blue_lobster_ 3 ปีที่แล้ว +1

    Thanks mate

  • @justphitness1659
    @justphitness1659 4 ปีที่แล้ว +1

    Would love to see a MOBA tutorial using Bolt. Followed your top down and a few others videos but now I’m lost.

    • @OneWheelStudio
      @OneWheelStudio  4 ปีที่แล้ว +1

      A MOBA is a pretty huge project! Your not the first to request it. I’m not sure how realistic it would be for me to attempt.

  • @JustBitsAndPieces
    @JustBitsAndPieces 3 ปีที่แล้ว

    i like this

  • @DonutDev
    @DonutDev 4 ปีที่แล้ว +2

    hey what about implementing thid in game aswell. like pressing "enter" lets say and a place where you can write the code. this was a great tutorial anyway :D

    • @OneWheelStudio
      @OneWheelStudio  4 ปีที่แล้ว

      Definitely do able. Just use an input field. Then rather than loop through “input.inputstring” loop through the text of the input field. There may be another hitch or snag but the general idea should be good.

  • @MKVProcrastinator
    @MKVProcrastinator 3 ปีที่แล้ว +1

    I suppose this wouldn't work for the Konami code, would it?

    • @OneWheelStudio
      @OneWheelStudio  3 ปีที่แล้ว +1

      Yeah not so much. That would need more of a "combo" tool to read and remember the inputs. A bit more complicated, but maybe not too bad.

  • @elite_ramsay1667
    @elite_ramsay1667 ปีที่แล้ว

    Has anyone been able to apply this to a form of gui of like a console?

  • @tmoneygamestudio
    @tmoneygamestudio 2 ปีที่แล้ว

    It's might just be a coincidence, but your voice sounds like the same one Odin Inspector videos uses with their videos.

    • @OneWheelStudio
      @OneWheelStudio  2 ปีที่แล้ว +1

      Definitely not a coincidence 😉 I’ve been making their videos for a couple years now.

  • @ElliotPixel
    @ElliotPixel ปีที่แล้ว +1

    If you're using an InputField and the new input system, it's also possible with only 63 lines of code.
    using System.Collections.Generic;
    using UnityEngine;
    // TH-cam removes the comment if it contains a link, so replace "DOT" with ".".
    using UnityEngineDOTEvents;
    using UnityEngine.InputSystem;
    using TMPro;
    using UnityEngine.EventSystems;
    public class CheatCodeManager : MonoBehaviour
    {
    [SerializeField, Tooltip("The cheat code input field.")]
    TMP_InputField inputField;
    string previousText;
    TMP_Text placeholder;
    [SerializeField]
    List cheatCodeList = new();
    void Awake()
    {
    // Gets the placeholder's TextMeshPro component.
    placeholder = inputField.transform.GetChild(0).GetChild(0).GetComponent();
    previousText = placeholder.text;
    }
    bool IsSelected()
    {
    return EventSystem.current.currentSelectedGameObject == inputField.gameObject;
    }
    void Update()
    {
    if (Keyboard.current.enterKey.wasPressedThisFrame)
    {
    // If enter is pressed and the input field is selected, do this.
    if (IsSelected())
    {
    CheckCheat(inputField.text);
    inputField.text = "";
    }
    }
    }
    bool CheckCheat(string _input)
    {
    foreach (CheatCodeInstance code in cheatCodeList)
    {
    if (_input == code.code)
    {
    code.cheatEvent?.Invoke();
    placeholder.text = previousText;
    return true;
    }
    }
    placeholder.text = "Invalid code.";
    return false;
    }
    }
    [System.Serializable]
    public class CheatCodeInstance
    {
    public string code;
    public UnityEvent cheatEvent;
    }

  • @cr4zy326
    @cr4zy326 3 ปีที่แล้ว +1

    88th like