Jump to content
Sign in to follow this  
GODSPEEDSNAKE

Move Object Over Time

Recommended Posts

Hey guys I been searching for days and can't seem to work out how I can move an object "over time" not just setpos getpos, but have it slowly move to the new setpos location.

Basically I have a brick wall that I wish to move under the ground when the trigger is activated. Right now it just appears and disappears, hoping I can make it move underground like a door.

Any help is greatly appreciated...

Warm Regards,

GODSPEEDSNAKE

Share this post


Link to post
Share on other sites

move it by a "for" loop.

create a new script called opengate.sqf. in it put:

_wall = _this select 0;
_id = _this select 2;
_wall removeAction _id;

for [{_i = 0},{_i < 2},{_i = _i + 0.05}] do {
_wall setpos [ getPos _wall select 0, getPos _wall select 1, (getPos _wall select 2) - 0.05];
sleep 0.05;
};

close = _wall addAction ["Close Gate","closegate.sqf"];

and then create another script named "closegate.sqf":

_wall = _this select 0;
_id = _this select 2;
_wall removeAction _id;

for [{_i = 0},{_i < 2},{_i = _i + 0.05}] do {
_wall setpos [ getPos _wall select 0, getPos _wall select 1, (getPos _wall select 2) + 0.05];
sleep 0.05;
};

open = _wall addAction ["Open Gate","opengate.sqf"];

and in the init field of the wall in the editor write this:

open = this addAction ["Open Gate","opengate.sqf"];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×