Hi, I have an imported model of a bullet, which is pointing downwards instead of forwards. Logically you would apply a (0, 0, 270) vector3 to point it forwards, however any way I try this ruins the program in some way and does not actually fix the issue. It arises because I assume the modelling software used for this swaps the y and z axis. How can I fix this?
I posted in scripting because I use a prefab which is instantiated in script, so I assume a solution in script is best.
If you really want to swap the axis of the vertices making up the mesh, then you’ll have to create a script to go through the mesh vertices, swap the values for y and z axis and save the newly created mesh as a new asset.
However, i imagine the problem is just that you are changing the rotation of the instantiated object, which is used in some way or another by the script, thus messing up its functionality. So instead of changing the orientation of the parent object itself, create a child object inside the prefab which you attach the bullet mesh to. You can then freely rotate this child ‘inside the parent’ to your desired orientation, without any effect on the parent rotation.
Personally I would load the model into blender, rotate it, and export it as fbx and you can set the forward axis. Another option is to put the model on a child gameobject and rotate it locally how you wish and then rotate/move the parent in game.