This site requires JavaScript, please enable it in your browser!
Greenfoot back
super_lag
super_lag wrote ...

2016/9/16

Issue with Intersect() method

super_lag super_lag

2016/9/16

#
I wish to use intersect method instead of getOneIntersectingObject(), intersect method it not accepting a class or an object as parameter. Can any one help by posting a sample or example of intersect method Thank you very much.
Super_Hippo Super_Hippo

2016/9/16

#
The method needs an Actor as the parameter. So you need a reference to the Actor and use this as the parameter.
danpost danpost

2016/9/16

#
super_lag wrote...
I wish to use intersect method instead of getOneIntersectingObject(), intersect method it not accepting a class or an object as parameter.
Try the 'isTouching' method, which uses a class as parameter. The 'intersects' method is intended to check for a specific actor instance, not for any object of a specific class.
You need to login to post a reply.