- Home /
Weird Edge Collider offset
I have a platform made from 1000 blocks which changes depending on music. Today I changed it so that the platform used a single edge collider instead of 1000 box colliders. I am getting a weird result when I set the edge colliders points, the points are set to the same height as the scaling of the corrisponding block. The edge collider is higher than the actual block height after scaling even though the have the same position. When the platform is flat the edge collider lines up fine with the, its only when height is added there is a problem (See image).
This is the code im using to adjust the scale of the platform and the height of the points of the edge collider.
private void Dynamic()
{
for(int i = 0; i < BlocksTransform.Length; i++)
{
Scale.y = Analyzer.ScanDb[Analyzer.CurrentPosition + i] * magnitude; //CurrentPosition = Current time position of song playing
BlocksTransform[i].localScale = Scale;
EdgePoints[i].Set(i,Scale.y);
}
BlockCollider.points = EdgePoints;
}
Basically my question is how do I fix this offset problem I'm having so that edge collider will always be the same height as the blocks. My apologies if I haven't explained my question well, if you need more info, please ask :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613162956im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Multiple Cars not working 1 Answer
C# Non-Static Member Rigidbody2D.MovePosition 1 Answer
AutoComplete Text in TextField 2 Answers