Hello,
I am trying to instantiate a prefab object in front of the player, so they can build a wall.
When they place the wall, it needs to be central to the camera (placed via its center).
Unfortunately, the wall’s pivot point is used to instantiate it. This means it is placed to far down and too far to the left.
I need to instantiate an object by its center, I can think of two ways to do this:
a) Place the object by its center somehow? Maybe there is some kind of option with the instantiate() function?
b) Change the pivot point to be the center of the object, I have no idea how to do this.
Just in case, I have tried changing the “pivot” button in the top left to center - it doesn’t work and I can’t see how it would help changing it :S
Thanks in advance,
~Joe
PS: Sorry for the stupid tag. Unity Answers is being stupidly buggy, suggested tags or not loading, the tag page isn’t loading and “object” was the only tag I could find that existed - if tags are working for you please edit this!
If it is not .fbx you can put it into a .zip file and post it here, I will then adjust the pivot point for you. The "pivot" point in the menu just changes where the editor transforms are in relation to the object. You could also write a vector offset in your placement script to sort it but that is a worse option that changing the pivot point itself. Anyway post it here if you can and I will fix it for you, Blender won't import .fbx though so I'm stuck if that is all you can give me!
– MrSoadIf you want to move it, try using using the [SetPivot editor script from the Unity Wiki.][1] [1]: http://wiki.unity3d.com/index.php?title=SetPivot
– robertbuMrSoad: Thanks for the offer, but I'd rather learn how to do it than get somebody else to :P Could you point me in the right direction of changing the pivot point in Blender please? I'd love to learn how to. roberbu: I'll try that in a few hours when my Unity actually starts up...
– ducsuus