Resetting gyro for turns in ROBOTC

I have just started to use a gyro on our robot for more accurate autonomous coding, which is working great. The issue is, from what I understand, gyro works like a compass in that the starting position will always be zero. So, when I try to make more than one turn, the robot won’t turn relative to its current location, it will turn from its absolute position. What would be the best way, if any, to reset (not recalibrate) the gyro value to 0 at the beginning of the turn method?

Also, I did see on this forum post that you can just write “SensorValue[gyroPort] = 0”. But in attempting to do so in virtual worlds, the value isn’t changed. Not sure if that is just a problem with virtual worlds or if it’s not possible.

its just resetGyro(port number or name of gyro) if you don’t know anything that kind of sounds like a function you can always look at the robotC documentation. I put a link to the reset gyro command in robot

http://help.robotc.net/Sandbox/Zendesk-Output/Content/Resources/topics/VEX_IQ/ROBOTC/Gyro_Sensor/resetGyro.htm

Just to clarify, does that work on VEX EDR? Because I’m getting a compile error when I try using it. I also noticed that in the link, it says VEX_IQ. If so, my bad for not clarifying in the post.

Oh sorry my bad, that was for Vex IQ, ^ that should work but I think if during the link it says VEX_IQ then you have to change it to cortex there’s a tab at the top and look through the menus at the top of robotc I don’t remember anymore because I only use vcs now. but if that doesn’t work maybe look at the other reply on the post that you linked because you could just use math. the one below