- Home /
Rescaling goes wrong?
Hey folks,
I'm facing a weird problem in Unity. And I'm not sure what I'm doing wrong actually. I have an edge that I rescale based on the two points it should connect. Now my code actually works, but my problem is, that the gameobject becomes a big box instead being a thin rectangle (like an edge should be). Basicly, it scales trough the y-coordinate too, which I'm obviously not doing.
 //the scaling
 this.EdgeTrans.localScale = new Vector3(edgeVec.magnitude, 1, 1);
 
 
  //how my object is transformed
 this.EdgeScale(this.EdgeVec);
 this.EdgeRotation(this.EdgeVec);
 Vector3 edgeTrans = this.StartVec + (this.EdgeVec / 2);
 this.EdgeTrans.position = edgeTrans;
I really dont know, why my gameobject would scale its y-coordinate too. I'm kinda confused. Am I overlooking something? I would appreciate any help, since I'm pretty new to Unity.
Regards,
IbrahimK.
I realised, that the y-coordinate isn't rescaled. The rotation causes what I meant. Any idea why this happens?
Your answer
 
 
             Follow this Question
Related Questions
How to preserve size of children when changing scale of parent 5 Answers
Player Car Runtime Scaling Issue 0 Answers
How is localScale adjusted when re-parenting transforms? 2 Answers
How to make an object's localscale values grow and shrink within a few seconds? 0 Answers
Attempting to Calculate and Change Scale of Platforms Sets Scale to 0 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                