Hello. I am making an RTS game and I’ve got into this problem when I was changing the humanoid object to BodyPosition. BodyPosition is not constant, so it is not useful for me. What are the recommended things that I should use in order to move a tank at a constant speed without using humanoid:MoveTo()?
BodyVelocity works.
Or just use a tween with linear tweenStyle
Alright, but I noticed there’s a problem with bodyvelocity where the position rendered is different from the position in the script
I would recommend Tweening. Its the easiest that I think will work for you.
Does collision still stay with tweening?
No. Can you explain in detail of what you’re trying to do?
Looks like tweening should do the job since you’re not colliding with too many objects.
Well, not really since that game has collision. Plus, colliding with buildings.
Just make a raycast to stop tweening if it hits an object
I am thinking just using velocity since it’s the easiest to use in this case.
Sure! Both ways work just with a few differences
TweenService is intended mainly for non-physically-simulated things, like UI, or client-side cosmetic effects. You generally should not use it to directly tween the position of things that have any physical interaction. You can technically tween a part by proxy, by tweening the Position of a BodyPosition, or Attachment that AlignPosition is referencing, but there are often simpler ways to script this than by using TweenService.