Modme Forums

models moving from one place to another

Game Modding | Call of Duty: Black Ops 3 | General Discussion


ModmeBot:

Thread By: Fil he Modder
ok, so i just want to know how i can get a plane model to move from on spot to another and then reset and do it again after a couple seconds? can someone help me out here?


ModmeBot:

Reply By: Harry Bo21

Fil he Modder
ok, so i just want to know how i can get a plane model to move from on spot to another and then reset and do it again after a couple seconds? can someone help me out here?


function moving_model()
{
	e_model = getEnt( "YOU_PICK", "targetname" );
	
	e_destination = struct::get( "YOU_PICK_AGAIN", "targetname" );
	
	v_start_origin = e_model.origin;
	v_end_origin = e_destination.origin;
	
	n_move_time = 5;
	n_wait_time = 5;
	
	while ( 1 )
	{
		wait n_wait_time;
		
		e_model moveTo( v_end_origin, n_move_time );
		
		wait n_wait_time;
		
		e_model moveTo( v_start_origin, n_move_time );
	}
}

level thread moving_model();

// model entity in radiant with whatever targetname you put in the above
// struct placed in radiant with whatever targetname you put in the above


ModmeBot:

Reply By: Fil he Modder
thanks man, i'll get check if it works and give FB


ModmeBot:

Reply By: Fil he Modder

Harry Bo21
Fil he Modder ok, so i just want to know how i can get a plane model to move from on spot to another and then reset and do it again after a couple seconds? can someone help me out here? function moving_model() { e_model = getEnt( "YOU_PICK", "targetname" ); e_destination = struct::get( "YOU_PICK_AGAIN", "targetname" ); v_start_origin = model.origin; v_end_origin = e_destination.origin; n_move_time = 5; n_wait_time = 5; while ( 1 ) { wait n_wait_time; e_model moveTo( v_end_origin, n_move_time ); wait n_wait_time; e_model moveTo( v_start_origin, n_move_time ); } } level thread moving_model(); // model entity in radiant with whatever targetname you put in the above // struct placed in radiant with whatever targetname you put in the above

also, could you do this with a prefab?


ModmeBot:

Reply By: Symbo
Sadly no. But you can take models in array and move them in a foreach loop.


ModmeBot:

Reply By: Fil he Modder
ok not a problem, but is there atleast a way so model just pops back into its original position instead of just moving backwards, kinda weird to look at ingame


ModmeBot:

Reply By: Harry Bo21
or link the two models


ModmeBot:

Reply By: yologirlgamer
: Compiler Internal Error : Uninitialized local variable 'model'

any help? I've linked the model to the struct


ModmeBot:

Reply By: Fil he Modder
on line 405, make sure you add e_ before the word model, i think harry just missed it out by accident


ModmeBot:

Reply By: Harry Bo21

function moving_model()
{
	e_model = getEnt( "YOU_PICK", "targetname" );
	
	e_destination = struct::get( "YOU_PICK_AGAIN", "targetname" );
	
	v_start_origin = e_model.origin;
	v_end_origin = e_destination.origin;
	
	n_move_time = 5;
	n_wait_time = 5;
	
	while ( 1 )
	{
		wait n_wait_time;
		
		e_model moveTo( v_end_origin, n_move_time );
		
		wait n_wait_time;
		
		e_model moveTo( v_start_origin, n_move_time );
	}
}

level thread moving_model();

// model entity in radiant with whatever targetname you put in the above
// struct placed in radiant with whatever targetname you put in the above