This is the AMP version of this page.
If you want to load the real page instead, click this text.

Help! no update function

power2020202020

Solid & Active Platinian
Hello, I wanted to change the damage percentage of the game I play, but the class has no update. The functions I wanted to change are damagedealt, damagedealtpercent, rewardmultiplier. They are all public but are inside the fields class. How do I fix this?
My game uses damage dealt to gain rank and resources in the game, only when I edit using int and float hooking normally nothing changes. How do I find an update for this class in the game code?
 
It might be called FixedUpdate or LateUpdate. Those should work too. If you don't have those either, try finding an Update, FixedUpdate or LateUpdate in a similar class. For example if your class is called PlayerStats, look for one of those 3 Updates in a class called PlayerBehavior (just as an example). In other words don't go to a class called EnemyBehavior. I mean when all else fails, it can't hurt to try them all, but it's more logical to start out with a similiar class, you know what I mean? You can also check this link out for more info about this issue:


Good luck.
 
FYI, I just used a START to hook instead of Update in a game and it worked.


Code:
// RVA: 0x123456 Offset: 0x123456 VA: 0x123456
    private void Start() { }

Can't hurt to try if you have a START. Good luck
 
FYI, I just used a START to hook instead of Update in a game and it worked.


Code:
// RVA: 0x123456 Offset: 0x123456 VA: 0x123456
    private void Start() { }

Can't hurt to try if you have a START. Good luck
WE do not need to call START. START only execute one frame. It is not part of the frame loop. If Start has a heavy workload (like loading assets, initializing objects, or performing expensive calculations), it can delay the first frame, making the FPS lower for that frame. It's only being called one per frame. It is a bad way to hook it, it's only useful if you have a specific goals such as debugging or logging before it becomes active OR prevent "specific" components from initializing. Reasons not to use Start is Start() only runs once when the script initializes. If you need repeated control, it’s better to hook methods like Update() or other event-based functions. If multiple scripts depend on Start(), changing behavior in one can cause unexpected side effects in others, which will be very hard to debug. Neither with Awake, it initializes first before Start() can be executed. Overall, your choices are LateUpdate or Update in total. FixedUpdate is okay, it does not have a frames per second to execute, as it is only for Unity's "Physics". FixedUpdate() does not have a fixed FPS because it runs based on a fixed time step, not per frame. It is mainly used for physics calculations because Unity’s physics engine (PhysX) runs in sync with FixedUpdate(). FixedUpdate() is a Unity lifecycle method that is called at a fixed time interval, independent of the frame rate (FPS). It is primarily used for physics-related updates such as Rigidbody movement and force calculations. Yes, FixedUpdate would work, but you will only get bugged Hooking and other methods that will not execute as properly as intended.


Your only options are using Update or LateUpdate, or find a update class and create a function within FindObjectsOfType/FindObjectOfType to get the instance of the class you want to modify and hook it from there.
 

Okay I see. Thanks for the clarification. Could you give me some more details possibly with an example about this:

create a function within FindObjectsOfType/FindObjectOfType to get the instance of the class you want to modify and hook it from there.

I am not clear on what this means or how to do it.
 
Sure, here is my tutorial that you will need to look into. It maybe complicated, but you will soon understand it.

 
Also I forgot to mention another way, see if within the class that if there's no update for that class, look within the field to see if it the class is accessible from there.
 
Wow you weren't kidding. Lol. It's definitely going to take me a while to digest this tutorial! Luckily though, for the game I just modded, it's such a lightweight game and hooking the Start() instead of update() works fine without any issues. I understand it's not the proper way to do it, and I totally get your point as a general rule of thumb. But I got lucky with this one
 
Anything is possible. You just gotta relax and put your mind to it. Not everything has to be hooked within Update. You can actually just call some methods and hook the functions itself without update. For example like aimbot, you don’t have to call it with update and unnecessary codes. I mean sure it is nice to call it in a method that calls 60 frames per second everytime, but that’s not the case. Everything or somewhat is possible, but it really depends on that game.

I had issues hooking within FixedUpdate, problem was that it’s only a fixed time. I was hooking with physics and its ragdoll for Telekill and Masskill. This caused the physics of the hooks to be broken and bugged really badly. It would freeze the bullets and freeze the players in its place instead of doing the actual telekill and masskill. Ragdolls were flying in pieces, cheats were lagging.
 
Oh yeah I totallly got you man. I am not at all doubting what you're saying. I just haven't had issues yet, and I am proceeding with baby steps because I'm still a beginner and I learn at my own moderate pace. Your tutorial is very valuable and insightful, and I absolutely saved it for future reference when I feel up to it. Thanks again my friend.