#tracking old position
1 messages · Page 1 of 1 (latest)
Oh frick, i thought i replied to you but i remember now someone sent a scam while i was typing up my response so i got distracted calling mods and then completely forgot what i was doing lol
You make a List <Vector3> Variable and constantly add your position to it. Depending on the rate of execution and how long ago you want your old position to be, you give it a threshold where once the list goes over that amount of items it starts just removing them as it adds more
I can't remember which is cheaper but you'll do either List Insert (index 0) > If (list count is greater than X amount) > List Remove Last or List Add > If (list count is greater than X amount) > List Remove At (index 0)
Then when you want to get that old position get either the first or last element depending on above. Might be safer to do the second way i suggested (List Add + List Remove At) and use List Get Element (index 0), as it covers the chance that someone might try to use it before the list reaches capacity. If your list hadn't reached your max size yet (say it goes up to 300 and a player almost immediately triggered it after loading in where it had only saved 120 positions, if you then used List Get Element (index 299) it would cause an error.
somthing like this?
how would i make this fully localized?
That should do! Though i'm concerned what you have that bottom Set Position attached to, i assume just a visual to show where that oldest position is? If so that's fine. Also not suuuper important but the List Remove At and List Get Element chips should be set to 0, not 1. Stuff like indices start counting from 0 so if you wanna make sure you're interacting with the "first" index of something make sure you use 0.
I chose to put it as one cuz it can bug out. And not position you because it's not getting a correct position. So if you put it as one it gets the one in front of that which is basically A small distance between zero and one. So I teleport the player to the point. So when it's constantly deleting from the list It won't give an error. Instead it'll always have a correct point to teleport to
0 shouldn't bug out, are you sure that's what you were experiencing and not something else? Technically it should be safer (by like the tiiiiiiniest little would-never-actually-be-an-issue amount) because element 0 is added to the list sooner than element 1. Do you know what kind of error it was logging as?
Oh god, i hope it wasn't a case of the game freaking out because you tried to use a position and then removed it right after, that should never ever be an issue for the game, once it's used it's used, it shouldn't matter what happens with it later 😬
Well the video above the map that did that has the problem so in there your trying to teleport to the position at 0 it would be fine with just 1 player but since a lot of people join and leave and stay it could bug out to were it deletes the position at 0 before setting position and before it could update so it would sed and error saying there's no position so I'm just trying to be safe with the system
list add
It's already answered btw
That does not answer anything
yes it does
its a circuit you need to make it