Hi! (I’m not quite sure if this thread is posted under the right topic)
I have the following problem. I added my flashlight.obj I created in blender to my Standard Asset Character Controller. I want it to follow the camera so it’s always in the bottom left corner. The problem is that whenever I look up or down, the flashlight gets stretched in a very strange way and I have no idea on how to fix that.
Does the camera that renders your flashlight have a different FOV than the main camera or something? Not sure if this would effect it, but maybe if your vertical rotation is in some way off, mismatched fields of view could cause this.
I’m not quite sure if I got that right. This would require two cameras to be there, wouldn’t it? But the whole scene only has that one camera placed on my controller. “but maybe if your vertical rotation is in some way off, mismatched fields of view could cause this.” - Do you know on how to fix that?
I added the flashlight as a child to the camera which is already moved by the controller script. I thought it would work like that.
I can make a .gif but the quality is not that good, sry.
(UPDATE: Okay, it wont let me upload the file… it says “The uploaded file is too large for the server to process.” even though it isn’t! I resized it so many times and it only has a size of 2MB…
There you go: http://prntscr.com/bdj4gb )
It looks to me like it is parented to something with non-uniform scale. When the child rotates, it aligns itself with a different axis (in this case, looking up or down will align with the Y axis) and if that axis has a different scale than the others, the child will stretch to match.
You can reproduce this effect easily by creating an empty object with scale (1,2,1), adding a cube as a child of that object and rotating the cube around x or z.
The fix would be to keep every object in your character’s hierarchy, down to the object that rotates, at a uniform scale (keeping things at (1,1,1) tends to be easiest, but as long as the x, y and z are the same on each object, it should work).
If you want to change the size of your character controller you should change the height or radius parameters on the character controller component itself, not scale the transform.
If there is something that you absolutely need to be non-uniform scale, then you could keep it in a separate ‘branch’ of your hierarchy to the rotating object, so it doesn’t affect it.