Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Make camera go forward into the direction it's facing

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bloodthirstymime
How do I cheat?
Reputation: 0

Joined: 11 Jul 2024
Posts: 1

PostPosted: Thu Jul 11, 2024 3:52 pm    Post subject: Make camera go forward into the direction it's facing Reply with quote

I have:

local baseAddress = 0x147309693A74

local xCoord = baseAddress - 0x0C
local yCoord = baseAddress - 0x0C - 0x0C
local zCoord = baseAddress
local orientationOffset = 0x30

And a function that's called when [W] is pressed

Code:

local function moveCameraForward()
    local camX, camY, camZ, camOrientation = getCameraPositionAndOrientation()

    local moveDistance = movementSpeed
    local yawRad = math.rad(camOrientation)

    local offsetX = moveDistance * math.sin(yawRad)
    local offsetY = moveDistance * math.cos(yawRad)

    writeDouble(xCoord, camX + offsetX)
    writeDouble(yCoord, camY - offsetY)
end


Yet I move only on the XYZ axis instead of the direction i'm facing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites