#tracking old position

1 messages · Page 1 of 1 (latest)

pliant coyote
#

tracking old position

valid wraith
#

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.

pliant coyote
#

how would i make this fully localized?

valid wraith
#

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.

pliant coyote
valid wraith
#

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 😬

pliant coyote
# valid wraith 0 shouldn't bug out, are you sure that's what you were experiencing and not some...

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

pliant coyote
wild oasis
inner slate
#

its a circuit you need to make it

wild oasis
#

A single circuit? You need a couple more for it to do literally anything

#

Thats like me saying ‘event receiver’ and nothing else