2,589
社区成员
发帖
与我相关
我的任务
分享
public int width = 6;
public int height = 4;
public int zPos = 3;
private void CreateWall()
{
for (int x = -width / 2; x < width / 2; ++x)
{
for (int y = 0; y < height; ++y)
{
GameObject go = Instantiate(block, new Vector3(x, y, zPos), Quaternion.identity);
go.transform.SetParent(Wall);
}
}
}
Is Kinematic为true的时候,表示物体不受外力,也就是该物体会静止不动,但仍能改变其他物体的运动状态,比如人撞上去了。Freeze Position是可以冻结某一个轴的位置,如勾上Y,就表示该物体在Y轴上不会产生位移。
勾上触发器
