Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Parsing to Vector3D always returns 0;0;0

Discussion in 'Programming (In-game)' started by 64nd41f, Mar 30, 2020.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Henrique Andreoli Trainee Engineer

    Messages:
    1
    Hello,

    Try a string like this: "{X:5 Y:5.12 Z:-3}"
     
  2. 64nd41f Trainee Engineer

    Messages:
    2
    Hi,

    after the last Update my conversion from String to Vector3D doesn't work anymore. Here an example:

    Vector3D PoSi = new Vector3D(5, 5, 5);
    string GPS = Me.Position.ToString();
    Echo(GPS); >> This returns [X:-4, Y:1, Z:2]
    VRageMath.Vector3D.TryParse(GPS , out PoSi);
    Me.CustomData = PoSi.ToString(); >> This returns X:0 Y:0 Z:0


    Can anyone help?
    --- Automerge ---
    Problem solved ;-)

    anything.Position.ToString(); adds "{" and "}" to the String . . . after getting rid of these it works fine . . .
     
Thread Status:
This last post in this thread was made more than 31 days old.