1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Can someone show me how to read a game variable?

Discussion in 'Programming Questions and Suggestions' started by pcsagan, Mar 17, 2019.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. pcsagan

    pcsagan Trainee Engineer

    Messages:
    3
    I've looked at the source code and tried to find working examples, but I just can't seem to do something as simple as get the position of my character. How do you make this code work?

    public override void UpdateAfterSimulation()
    {
    if (!MyAPIGateway.Input.IsNewKeyReleased(MyKeys.F8))
    return;

    MyAPIGateway.Utilities.ShowNotification(..., 10000, MyFontEnum.White);
    // What replaces '...'? I've tried 40 different things here like Sandbox.ModAPI.IMyEntity.GetPosition().ToString()
    }

    Thanks.
     
Thread Status:
This last post in this thread was made more than 31 days old.