I have two objects base and weapon and I need to set rotate point of weapon to position of base.
public Test(){
position1 = new Vector3(0,0,0);
baseModel = m
A rotation around a point is the same as translating to that point, rotating and then translating back.
So this process consists of 3 steps:
rotationPoint
, for example translate(3, 0, 0)
rotationPoint
), for example rotate(0,1,0, 45*delta)
translate(-3, 0, 0);
In this case the code then looks like this:
weapon.transform.translate(3, 0, 0).rotate(0,1,0, 45*delta).translate(-3, 0, 0);