friuns2 / LuaMod

Mod existing unity3d game with lua on android and PC

Home Page:http://brutalstrike.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mod existing unity3d game with lua at runtime on android and PC

Simple character movement logic

public class PlayerTest : MonoBehaviour
{

    public CharacterController cc;
    public float yVel;
    public void Update()
    {
        if (!cc.isGrounded)
            yVel -= 10 * Time.deltaTime;

        var x = Input.GetAxis("Horizontal");
        var y = Input.GetAxis("Vertical");
        var move = new Vector3(x, yVel, y);
        cc.Move(move * (Time.deltaTime * 10));
    }

}

Adding jump logic at runtime

 LuaMod.PatchAll(@"

PlayerTest  ={} 

function PlayerTest:Update ()
    if Input.GetKeyDown(KeyCode.Space) then
        this.yVel = 3;    
    end
    base:Invoke()
end
");
Brutal.Strike.Devlog.2021.11.14.574.mp4

Discord: https://discord.gg/bxVky7seqa

About

Mod existing unity3d game with lua on android and PC

http://brutalstrike.net/

License:MIT License


Languages

Language:C# 76.8%Language:C 23.2%Language:C++ 0.0%