| We hope you enjoy your visit. You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you are already a member please log in to your account to access all of our features: |
| Problem with collision; Can't figure out where the problem is | |
|---|---|
| Tweet Topic Started: Mar 12 2009, 01:00 AM (436 Views) | |
| hepolite | Mar 12 2009, 01:00 AM Post #1 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
I'm havng a little problem with my collision code, and I can't find out where the error is. This code works for some unknown reason in another game I have, but here, it doesn't work... It always detects a collision, even when I'm belove the solid things. I did my best, but I failed, so I hope someone here can help me out. Here's the code I'm using:
|
![]() |
|
| MysteriXYZ | Mar 12 2009, 02:58 PM Post #2 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I guess you're setting the collision shape to non-solid before collision checking, to test if you can disable collisions with it? If you're still getting collisions, there must be other objects in room 5 that are still solid. (Btw, make sure that "collision" is not an instance id, but an u3d index). Apart from that, any particular reason why you pass roty, rotx, rotz in that order to AttemptMoveToPosition(...)? |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| hepolite | Mar 12 2009, 04:30 PM Post #3 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
Currenly, I only have the player and a level in the room. I tried to make everything unsolid, and it still detected a collision... After messing a litte bit around, it seems to sort of work, but if the player goes under the level, the whole thing is bugged up again. I removed he rotx/y/z, it seems like i didn't do too much. I had it there because the length and width of the model is not the same. This is how I load the collision box and the model (I do the same for the level, except I have another collision model there):
|
![]() |
|
| MysteriXYZ | Mar 12 2009, 05:59 PM Post #4 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
So you have 2 GM objects, each with a collision shape belonging to room 5? If you execute the code I quoted in my previous post for each collision shape (that is, twice per step), then the one for which it is executed first will be detected during the second execution, since it's set back to solid at the end of that code. If that's not it, make room 5 visible and check exactly what object the player is colliding with. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| hepolite | Mar 12 2009, 09:56 PM Post #5 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
I set the cllision model unsolid, otherwise the player character would collide with this model instead. The level is solid all the time, I don't change it's solidity. I tried to make room 5 visible, but I didn't see what was wrong. The I did another test, I tried to check for collisions with room 10, even if there's nothing there. Collisions were detected. I know I can't provide enought information, so I just have to post the source code. I hope the problem can be solved... (I doubt that people would steal a game with just a camera, level and a player..) Edited by hepolite, Mar 12 2009, 10:11 PM.
|
![]() |
|
| MysteriXYZ | Mar 13 2009, 05:20 PM Post #6 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That's definitely not normal. Maybe it's because you're using an outdated extension (2.1 Beta), so upgrade to the latest version and see if that helps. |
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| hepolite | Mar 14 2009, 01:58 PM Post #7 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
I downloaded the final GEX file, and it didn't help much. I tried to make a new collision code, but I ran into a problem there too. The player seems to stop in mid-air for no reason, then continue to fall after a few seconds.
It does detect collisions, but also when there's no solid models close up. EDIT: It appears to be a precision glitch with "if (z != z2)". I added ceil around both of them, and no more collision were detected in mid-air. But it's still some weird things going around. The player bounces when he stands still on the ground, and it looks really bad. Edited by hepolite, Mar 14 2009, 02:16 PM.
|
![]() |
|
| MysteriXYZ | Mar 15 2009, 02:21 PM Post #8 |
|
Master Matrix Masher
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That's exactly what's causing the bouncing. Try the following instead:
|
| U3D is like candy; after extensive consumption, it's Best to brush. | |
![]() |
|
| « Previous Topic · Questions about Ultimate 3D · Next Topic » |





![]](http://z1.ifrm.com/static/1/pip_r.png)



Start.gmk (55.89 KB)
4:40 PM Jul 11