Jump to content

1 post in this topic

Recommended Posts

Posted

I am making fly function which will make my character fly but its not working as it should be i dont know why its not working. It was done similarly on android i recreated it on ios here is what i have done.
 

void (*Old_PlayerController_Update)(void *myPlayer);
void PlayerController_Update(void *myPlayer)
{
    if (myPlayer != NULL) {

        // Function pointers for Rigidbody methods
        void (*set_velocity)(void *, Vector3 value) = (void (*)(void *, Vector3))getRealOffset(0x2785420);
        void (*MovePosition)(void *, Vector3 position) = (void (*)(void *, Vector3))getRealOffset(0x2785E10);
        Vector3 (*get_posRigidbody)(void *) = (Vector3 (*)(void *))getRealOffset(0x2785C18);

        if (show_fly){       
            void *myRigidbody = *(void **)((uint64_t)myPlayer + 0x428); // Get Rigidbody pointer
            if (myRigidbody != NULL) {
                Vector3 MyPos = get_posRigidbody(myRigidbody); // Get current position

                set_velocity(myRigidbody, Vector3(0.0f, 0.0f, 0.0f));

                // Fly up
                if (setFly) {
                    MovePosition(myRigidbody, Vector3(MyPos.x, MyPos.y + valueFly, MyPos.z));
                    setFly = false; // Reset after moving
                }

                // Fly down
                if (setFly2) {
                    MovePosition(myRigidbody, Vector3(MyPos.x, MyPos.y - valueFly, MyPos.z));
                    setFly2 = false; // Reset after moving
                }
            }
        }
    }
    return Old_PlayerController_Update(myPlayer);
}


and i hook uodate like this:
HOOK(0x101E7C8, PlayerController_Update, Old_PlayerController_Update);


here functions from dump.cs:
functions or offsets in dll arelike this:
// RVA: 0x2785E10
	public Void MovePosition(Vector3 position) { }

// RVA: 0x2785420
	public Void set_velocity(Vector3 value) { }

// RVA: 0x2785C18
	public Vector3 get_position() { }

 
Here is preview what it does when i activate this function try to fly:
https://file.io/OZrl5THtXDf7

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines