gitrinec 6 Posted January 8, 2020 Is it possible to keep an object next to the ground and move it. Not a setpos but where you can visually see it moving. Not, walk or drive, etc. Would you have to attachto and hide a different object? Share this post Link to post Share on other sites
Grumpy Old Man 3549 Posted January 9, 2020 16 hours ago, gitrinec said: Is it possible to keep an object next to the ground and move it. Not a setpos but where you can visually see it moving. Not, walk or drive, etc. Would you have to attachto and hide a different object? You could always use one of the velocity commands, similar to this: oneachframe {testObject setVelocity velocity player} Cheers 1 Share this post Link to post Share on other sites
johnnyboy 3797 Posted January 9, 2020 Also, setVelocityModelSpace. Here's the example from wiki: car setVelocityModelSpace [0, 10, 0]; //pushes car forward in direction car is facing You can use the one time to bump an object in some direction. Or use it in onEachFrame as Grump suggested, to continuously move an object at a set speed. 1 Share this post Link to post Share on other sites
Larrow 2823 Posted January 9, 2020 If its just a simple object just use vectorLinearConversion. Spoiler h = [] spawn { _timeTakenToMove = 10; _timeFrom = time; _timeTo = _timeFrom + _timeTakenToMove; _posFrom = player getPos[ 10, getDir player -45 ]; _posTo = player getPos[ 10, getDir player +45 ]; _object = createVehicle[ "Land_Pillow_camouflage_F", _posFrom, [], 0, "CAN_COLLIDE" ]; while { time <= _timeTo } do { _curPos = vectorLinearConversion[ _timeFrom, _timeTo, time, _posFrom, _posTo, true ]; _curPos set[ 2, 0 ]; //0 keep it on the ground _object setPosATL _curPos; _object setVectorUp surfaceNormal _curPos; //rotate to match ground normal }; _object setPosATL _posTo; //time finished, just make sure object is at _posTo }; 5 1 Share this post Link to post Share on other sites
pierremgi 4909 Posted January 10, 2020 And, if you're skilled... setVelocityTransformation 2 Share this post Link to post Share on other sites
Alert23 215 Posted January 17, 2020 (edited) On 1/9/2020 at 4:25 PM, Larrow said: If its just a simple object just use vectorLinearConversion. Hide contents h = [] spawn { _timeTakenToMove = 10; _timeFrom = time; _timeTo = _timeFrom + _timeTakenToMove; _posFrom = player getPos[ 10, getDir player -45 ]; _posTo = player getPos[ 10, getDir player +45 ]; _object = createVehicle[ "Land_Pillow_camouflage_F", _posFrom, [], 0, "CAN_COLLIDE" ]; while { time <= _timeTo } do { _curPos = vectorLinearConversion[ _timeFrom, _timeTo, time, _posFrom, _posTo, true ]; _curPos set[ 2, 0 ]; //0 keep it on the ground _object setPosATL _curPos; _object setVectorUp surfaceNormal _curPos; //rotate to match ground normal }; _object setPosATL _posTo; //time finished, just make sure object is at _posTo }; hi, how is it possible to make this script slide an object between two positions in a loop? Edited January 17, 2020 by Alert23 Share this post Link to post Share on other sites
Larrow 2823 Posted January 18, 2020 Spoiler h = [] spawn { _timeTakenToMove = 10; _posFrom = player getPos[ 10, getDir player -45 ]; _posTo = player getPos[ 10, getDir player +45 ]; _object = createVehicle[ "Land_Pillow_camouflage_F", _posFrom, [], 0, "CAN_COLLIDE" ]; while{ true } do { _timeFrom = time; _timeTo = _timeFrom + _timeTakenToMove; while { time <= _timeTo } do { _curPos = vectorLinearConversion[ _timeFrom, _timeTo, time, _posFrom, _posTo, true ]; _curPos set[ 2, 0 ]; //0 keep it on the ground _object setPosATL _curPos; _object setVectorUp surfaceNormal _curPos; //rotate to match ground normal }; _object setPosATL _posTo; //time finished, just make sure object is at _posTo _tmp = _posFrom; _posFrom = _posTo; _posTo = _tmp; }; }; 1 2 Share this post Link to post Share on other sites
7erra 629 Posted January 18, 2020 @Larrow If BI didn't change the setPos command family then it is not MP friendly. Last time I tested it the executing instance saw the object move smoothly while I saw it warp across the scenery as if only every nth command was broadcasted. This might be because the every frame refers to the frames that the script executor has and not the other clients'. This was like 2 years back though... My two cents would be to use Keyframe Animation. 2 Share this post Link to post Share on other sites
Larrow 2823 Posted January 18, 2020 Both suffer from exactly the same problem. The keyframe animation uses setposASL from the server, the module is server execute only and is server authoritative. This is me as a client on a local dedicated server. Tell me which is a timeline keyframe animation and which is my script from above. 3 Share this post Link to post Share on other sites
7erra 629 Posted January 18, 2020 Hmm that's not good. Next two ideas: Run the script on each client remotely with a createVehicleLocal object Attach the object to an invisible unit, let that unit move from point A to point B 2 Share this post Link to post Share on other sites
Larrow 2823 Posted January 18, 2020 Number 1 is most likely the best option. Still have the server authoritative on when to stop/start the movement but with each client having their own local object and then just use serverTime to sync the vectorLinearConversion across all machines. 1 Share this post Link to post Share on other sites
noewon 1 Posted January 28, 2021 how did you go with this? I'm attempting to set up a hidden panel that slides open when triggered but am having no joy with the animation of moving an object. Share this post Link to post Share on other sites
gitrinec 6 Posted May 13, 2023 This is for a vehicle, sorry for such a late reply, was away from editing for a while. The idea was to have a vehicle moving upside down and sliding on its roof. On 1/18/2020 at 7:43 AM, Larrow said: Reveal hidden contents h = [] spawn { _timeTakenToMove = 10; _posFrom = player getPos[ 10, getDir player -45 ]; _posTo = player getPos[ 10, getDir player +45 ]; _object = createVehicle[ "Land_Pillow_camouflage_F", _posFrom, [], 0, "CAN_COLLIDE" ]; while{ true } do { _timeFrom = time; _timeTo = _timeFrom + _timeTakenToMove; while { time <= _timeTo } do { _curPos = vectorLinearConversion[ _timeFrom, _timeTo, time, _posFrom, _posTo, true ]; _curPos set[ 2, 0 ]; //0 keep it on the ground _object setPosATL _curPos; _object setVectorUp surfaceNormal _curPos; //rotate to match ground normal }; _object setPosATL _posTo; //time finished, just make sure object is at _posTo _tmp = _posFrom; _posFrom = _posTo; _posTo = _tmp; }; }; Share this post Link to post Share on other sites