 |
|
|
|
|
 |
|
|
Guest
|
How do i do the collision detection code? -
11-01-2009, 05:55 PM
Hi im making an object runing behind another object. when i last object catch up the front object, i want him to turn and pass the front object. How can i make this possible? thanks a lot
ps: i tried the distance function with if and else statement but its not working. object is still going through another.
Last edited by xyflz; 11-01-2009 at 06:30 PM.
|
|
|
|
|
Super Moderator
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
|

11-01-2009, 06:38 PM
Odds are, the if/else if statment needs to be put into an infinity loop, then put into a do together method along with the method to make the character move. This way, the world will be constantly checking to see if the character is close enough to the object to collide with it.
|
|
|
|
|
Guest
|

11-01-2009, 08:45 PM
i think i did that but i will check it again. thanks for tip
|
|
|
|
|
Guest
|

11-01-2009, 08:47 PM
yea thats what i did but its still not working. can you check it for me please?
Last edited by xyflz; 11-01-2009 at 08:51 PM.
|
|
|
|
|
Guest
|

11-01-2009, 08:55 PM
btw. when i use a method. how can i just remove the duration part without removing the whole method?
|
|
|
|
|
Super Moderator
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
|

11-01-2009, 09:11 PM
You can't. If you change it, it'll stay there forever unless you delete it and re-insert it. It's one second by default, though, so if you want to change it to the default, change it to 1 second.
I'm taking a look at the world right now.
|
|
|
|
|
Guest
|

11-01-2009, 09:14 PM
ok no wonder it wont let me do anything. yea when the chicken pass the turtle, chicken should run around the the turtle and talk. However,its not working at all.
your video on youtube is awesome i like it lol.
|
|
|
|
|
Super Moderator
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
|

11-01-2009, 09:21 PM
Nope, you put the collision detection method INSIDE the loop, not next to it in it's own loop inside the main do together method.
Put the if/else if statement in it's own, seperate loop, outside the chicken's motion method, and it'll work.
|
|
|
|
|
Guest
|

11-01-2009, 09:28 PM
ok i see. im trying to make the them going around another when they pass the slower object. how do i make that work?
|
|
|
|
|
Super Moderator
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
|

11-01-2009, 09:53 PM
The way the world is now, you can't. You'll have to change the movement methods to something like:
"While (animal) is at least .05 meters away from beach chair 1"
(animal) move forward .03 meters duration 0 seconds.
With the move to methods, each animal is locked on a linear path to each chair, unable to move to the side.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Copyright ©2023, Carnegie Mellon University

Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.
|
 |