Page MenuHomeFeedback Tracker

setPos doesn't work for JIP, but it changes getPos value
Need More Info, WishlistPublic

Description

If you try to teleport player from init.sqf it will do so for the 1st player joining mission. JIP player will not teleport physically but only theoretically

Details

Legacy ID
672211593
Severity
None
Resolution
Open
Reproducibility
Always
Category
Engine
Steps To Reproduce

put this in init.sqf

if (!isDedicated) then {

waitUntil {!isNull player};
waitUntil {time > 0};
_ppos = getPos player;
player setPos [0,0,0];
hint format ["spawn pos: %1\nteleport to: [0,0,0]\ncurrent pos %2", _ppos, getPos player];

};

start dedicated server and join, you will appear in the water

hint will show

spawn pos: (your editor position) [whatever not important]
teleport to [0,0,0]
current pos [0,0,0] - in the water where you are all good

drop to the lobby and back....you are at default editor position not at [0,0,0] in the water, but hint shows

spawn pos: (your editor position) [whatever not important]
teleport to [0,0,0]
current pos [0,0,0]

again! "current pos" is getpos player after teleport. A. you never teleported as you should and B. getpos player shows you are teleported when you didn't!

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Engine.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 672211593.May 7 2016, 6:24 PM

Hello,

would it be possible to upload a simple repro mission?

Thank you very much

Ok add to this that it is random! Just retested and teleport didn't happen on the second JIP not the first one