1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UE3 - UDK Vehicle Stats.

Discussion in 'Programming' started by bigshow, Sep 20, 2011.

  1. bigshow

    bigshow New Member

    Joined:
    Sep 15, 2011
    Messages:
    3
    Likes Received:
    0
    Hi guys, i was wondering if i could get the current data(speed, steering) from a vehicle? I looked around for quite some time , wondering if there is any way i could access these data from udk itself? Edit: I need to display the speed.

    Thanks.
     
    Last edited: Sep 20, 2011
  2. EvilT-ModZ

    EvilT-ModZ Un-Gravitify

    Joined:
    Aug 3, 2011
    Messages:
    42
    Likes Received:
    0
    So, try it
    code for your vehicles's hud
    Code:
    var YourVehicleClass Car;
    var float CarsSpeed;
    
    // (im not sure what function uses in ut3's hud)
    // write new hud content
    simulated event PostRender( canvas Canvas )
    {
            CarsSpeed = VSize(Car.Velocity);
    
    	Super.PostRender(Canvas);
    	Canvas.Style = ERenderStyle.STY_Alpha;
    	Canvas.SetDrawColor(255,255,255,255);
    	Canvas.Font = Canvas.MedFont;
    	Canvas.SetPos(0.703*Canvas.ClipX, 0.056*Canvas.ClipY); // 0.703 and 0.056 are coefficients of screen location
    	Canvas.DrawText("Speed: "$CarsSpeed);
    }
    
     
    Last edited: Sep 22, 2011
  3. kiff

    kiff That guy from Texas. Give me some Cash

    Joined:
    Jan 19, 2008
    Messages:
    3,793
    Likes Received:
    0
    if you want the input to the steering then use: myVeh.Steering

    if you want the actual wheel's steering/rotation: myVeh.SimObj.ActualSteering
    probably need to do a typecast there, like: SVehicleSimBase(myVeh.SimObj).ActualSteering
     
  4. bigshow

    bigshow New Member

    Joined:
    Sep 15, 2011
    Messages:
    3
    Likes Received:
    0
    Thanks guys, will read up on it.
     

Share This Page