I am making a sort of turret that shoots at enemies. I would like the barrel of the turret to aim at the enemy, but I can’t figure out how to make it look right. (Ignore how bad the model of the turret is, it’s just a prototype)
This is what the turret looks like in the explorer.
Basically, there is a pole and a barrel which are next to eachother, like this.
Edit the Pivot Offset of the barrel so that the pivot point is where the pole is. Then, you can apply the same CFrame to both, which is a performance benefit as well.
You forgot to use PivotTo, which can exclusively be used for pivot offsets. Another possible way to do this that might be better or worse is to group them together to apply the pivot to both in one line of code as opposed to two.
I tried this and it seemed to be facing the opposite direction of the enemy (maybe not exactly the opposite but it wasn’t facing towards the enemy) I can provide screenshots if you want
You’d group the barrel and the pole together. Use PivotTo on the model. Simple as that. An advantage of this would be that you’re able to have the turret pivot point adjusted.
Is the CFrame inverted, or is it just the opposite?