Navigation
Browse the developer docs

FH2 Mod Platform for .NET

Player

Credits, level, skill points, the current car and teleporting.

By Bartholomew Ho (qiangqiang101) · MIT license · v0.12.0 · 15 Nov 2026 · repository · original page

On this page

You: your credits, level, skill points, the car you're driving, and teleporting it somewhere new.

Thread: game thread only (Game.Tick, Game.Run, or an ANNA entry). CanTeleport can be read from any thread.

Example

Two ANNA menu entries: one gives you 10,000 credits, one takes you to the waypoint you set on the map.

protected override void OnInit()
{
    // ANNA entries run on the game's thread.
    ANNA.Menu.Add("Get 10,000 CR", () => Player.Credits += 10_000);
    ANNA.Menu.Add("Go to waypoint", () =>
    {
        var target = World.Waypoint;
        if (target is not null && Player.CanTeleport)
            Player.TeleportTo(target.Value);
    });
}
Protected Overrides Sub OnInit()
    ' ANNA entries run on the game's thread.
    ANNA.Menu.Add("Get 10,000 CR", Sub() Player.Credits += 10000)
    ANNA.Menu.Add("Go to waypoint",
        Sub()
            Dim target = World.Waypoint
            If target IsNot Nothing AndAlso Player.CanTeleport Then
                Player.TeleportTo(target.Value)
            End If
        End Sub)
End Sub

Members

Properties

MemberWhat it does
Car (property, get, Vehicle?)The car you're driving this frame, or null (in a menu, on the title screen).
Credits (property, get/set, int)Your credits (CR), as the HUD shows them. Values below 0 are set as 0.
Level (property, get, int)Your driver level.
SkillPoints (property, get/set, int)Skill points to spend in the skill tree. Values below 0 are set as 0.
CurrentGarageId (property, get, int)The garage id of your current car (Garage > Change car). Use it with Garage.
CanTeleport (property, get, bool)True if TeleportTo can be used on this game build.

Methods

MemberWhat it does
TeleportTo(Vector3 position)Puts your car on the road nearest position, facing along it, as the game's fast travel does: on the ground, stopped. Only X and Z need to be right.

Notes

  • Player.Car is null when you're not driving. Check for null (Is Nothing in VB) before using it.
  • Player.Car is only valid for the frame you got it in. Get it again each tick; don't keep it.
  • Credits, Level, SkillPoints and CurrentGarageId read and write the current profile. They throw an InvalidOperationException when no profile is loaded yet (the title screen). Changes reach the save the next time the game saves.
  • After TeleportTo, the world loads around the car for a moment. The car is held still for about 2.5 seconds, and placed again after about 1.5 seconds.
  • TeleportTo throws an InvalidOperationException if CanTeleport is false, or if the game's fast travel isn't there (for example, when you're not in free roam).
  • On a game build the SDK doesn't know, CanTeleport is false and platform.log says so ("Player.TeleportTo off"). If the whole Game class is off, nothing runs on the game thread at all; see Game.
  • Using these members off the game thread throws an InvalidOperationException that says to use Game.Tick or Game.Run.

See also

Copied from the wiki page Player at commit 7396a07 · MIT license
MIT License

Copyright (c) 2026 Bartholomew Ho

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.