Skip to content

Weird type behaviour with Vector3 #1

@Smorty100

Description

@Smorty100

I use this plugin to save some positions. Currently I do it like this:

SaveSystem.set_var(G.temp["SCENE_NAME"] + "_CHECKPOINT", %Spawn.global_position)
SaveSystem.save()
print("Type of position is " + str(typeof(%Spawn.global_position)) + " but saved type is " + str(typeof(SaveSystem.get_var(G.temp["SCENE_NAME"] + "_CHECKPOINT"))))

That last line is to check if the saved position and the actual position are of the same type, and they are! They are both a 9, which is a Vector3.
BUT! When I try to access that value after closing and opening the game, it gives me a String! It's a string with the Vector3 inside of it, kinda like this:
var savedPosition:String = "(4.43, 345.534, 543234.5453)"
Now that is some really weird behaviour, and will require some workarounds to get it working as intended...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions