Hi everybody, i've been trying to make a decent tank game for sometime and i'm getting somewhere, but i have a problem, i made a tank and rigged it's tracks believing i could make so the position of the bone is equal to the position of the tank wheel (or the other way around, dunno), it's a cheap way of getting tracks to work like in a tank, but i'm struggling to make it work, here's what i got:
func _process(delta):
for LB in 5:
var t = $Armature/Skeleton.get_bone_custom_pose(LB)
t.origin.y = LWS[LB].global_transform.origin.y
$Armature/Skeleton.set_bone_custom_pose(LB, t)
for RB in 5:
var t = $Armature/Skeleton.get_bone_custom_pose(RB)
t.origin.y = RWS[RB].global_transform.origin.y
$Armature/Skeleton.set_bone_pose(RB, t)
basically it should work, the tank has 5 wheels on each side, and the track has an skeleton with bones for each of the wheels on each side, weight painted to move only their part of the tracks, but i'm lacking the logic so it could function properly, LWS and RWS are arrays with all of the VehicleWheels of the tank, LWS is for the left side and RWS for the right side, and i use them to move the tank by adding power directly to the wheels (so i can neutral steer and manouveer like a tank does), but how can i achieve what i'm looking for?
Thanks in advance for any help!