Skip to content

friuns2/LuaMod

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 76.8%
  • C 23.2%