I'm trying to read a float using the VAMemory library, and I have the base offset and the offsets to be added to the pointer from CE, and I know they reference the value correctly (have been changing values accordingly in CE)
Here are the offsets as shown by CE: (According to previous questions on this topic, they should be applied from bottom to top as they appear in CE)

I've tried multiple implementations of "dereferencing" the pointers on each iteration, as the offsets have to be added one after the other, I'm not sure if I'm getting the base address correctly, if I should iterate through the modules of the process instead and match it with the name as I've seen done in other questions. I'm now trying to use an implementation that was shown in a similar question however the value I'm getting returned is always 0
private static float GetPointerValue(IntPtr baseAddress, int[] offsetArr)
{
VAMemory vam = new VAMemory("amtrucks");
//Adding original offset to base address
IntPtr pointer = IntPtr.Add((IntPtr)vam.ReadInt32(baseAddress + 0x014BC410), offsetArr[0]);
for (int i = 1; i < offsetArr.Length; i++)
{
pointer = IntPtr.Add((IntPtr)vam.ReadInt32(pointer), offsetArr[i]);
}
return vam.ReadFloat(pointer);
}
public void SetCam(float height)
{
Process GameProcess = Process.GetProcessesByName("amtrucks").FirstOrDefault();
IntPtr BaseAddress = GameProcess.MainModule.BaseAddress;
//Offsets in reverse order
var offsetArr = new int[] { 0x18, 0x40, 0x0, 0x3C8, 0x48};
Console.WriteLine("value:" + GetPointerValue(BaseAddress, offsetArr));
}
It doesn't throw any exceptions or error message, but the value is always 0 (actual value is around 43)