Topic: Rotate tileset at center AND follow game object
Hi Alex, I have the following hierarchy:
RotationParent (compass rotation script)
-- Tileset Map (follow AR camera script)
The rotation parent setup allows the compass to rotate the tileset map at its center. This works great.
I use the FollowGameObject script on the tileset to have the map follow my AR camera. This works great too, but only if the compass rotation script isn't enabled; otherwise the map will jump out of position AND leaves the parent gameobject behind.
My problem is I can't figure out how to get the rotation of the map (at its center) from the compass AND the map follow the AR camera working together. As I said these two features work alone, but not together.
I tried attaching the followGameObject script to the RotationParent instead of the tileset map, but results were weird.
I tried adding another parent (for the follow script) using a hierarchy like this:
PositionParent (follow AR camera script)
-- RotationParent (compass rotation script)
-- Tileset Map
...with the following modification to the followGameObject script:
// assign pos
//map.transform.position = pos;
// try this
transform.position = pos;
but I'm sure you can imagine nothing I do is working, including this hierarchy. Things come close though.
Thought I'd see if you could make a suggestion on how to wire this up. Hopefully you can make sense of what I'm trying to do.
Regards.