how can I attach my sword to my character, without making them stop each other
Make the sword either passable or set
my.group = 123; // or another number
in your sword and player code. Your player movement code must use IGNORE_PUSH then to make it work in all c_trace and c_move instructions.
and when my character animates(like running or attacking), then I want my sword to stay in the hand of the character and follow the hand. how do i do this?
You have 2 options:
(1) You animate the sword exactly like your player is animated and you update your swords frames: sword.frame = player.frame (and next_frame maybe, too).
(2) Code it:
VECTOR temp,temp2;
proc_mode = PROC_LATE;
while(1) {
vec_for_vertex(my.x,player,123); // attach the weapon to player's vertex 123
vec_for_vertex(temp,player,456); // choose 2 vertices of the player's hand that determine the weapon's rotation
vec_for_vertex(temp2,player,789);
vec_diff(temp,temp2,temp);
vec_to_angle(my.pan,temp); //
wait(1);
}
This should work, at least you get the idea!