Hi! I recently started playing with Unity. I have a problem with attaching the object to my player so that it could be, for example, a gun(I want only one end of the object to be attached and the other to follow the mouse). I couldn’t find the right guide on the internet and I can’t program well enough in C # to solve it myself. Could anyone show what it should look like?
If i understood correctly this is what i would do: object player, object gun child of player.
player has the script for the normal movement
gun has the script for the gun control (follow the mouse?)
One solution to this could be to have one bit of logic to rotate the player, and another piece of logic that would rotate the gun. If you want to keep the base of the gun attached to the player you could try setting a custom pivot by giving the object another parent object located wherever you want the pivot to be and having it rotate around that.