开发者

Colliding an object

I'm taking my first steps through Unity, as a follow up to this question:

http://answers.unity3d.com/questions/56697/isometric-game-camera-limits

I now realized that I don't know how to make a collider actually collide. Now I have a GameObject I move around instead of the camera, and the camera is a child to that object. It has a box collider, and there're four other box colliders around the level so it will collide against them.. and it's not working, of course, because I was changing the position variable by hand. What do I do so this collides? use a rigidBody and apply forces to it? is there a way to put a maxVelocity on it? I can't see one, besides a rigidbody seems sort of overkill for what I'm trying to do. Otherwise I guess I just put m开发者_如何学运维ass 1, and export drag and force, but I'd much rather work with a maxSpeed, because drag will also affect the acceleration rate


I don't know if you have missed any steps but I can tell you what I've done if it helps any. Create a game object. Click on the object in the hierarchy and go to the top menu and component->physics->box collider.After you add the box collider you may have to adjust the size of the colliders as well. In addition make sure you character you are walking around with also has a collider.


You can take a programmatic approach. Do I get you right that you want to drag the cam around with the mouse or move it with keys? You can check the camera position by hand and apply boundings that way. It is quite easy to implement if your camera is locked into a single box.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜