Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Physics Ray Casting

Author
Message
greycheek
8
Years of Service
User Offline
Joined: 13th Mar 2016
Location:
Posted: 29th Aug 2016 22:03
I have the following code:



If the code finds trees tiles on a map, then it adds a sprite shape box to a dummy sprite equal in dimension to that tile. The shape box is assigned to a "Block" category. Then the code casts a physics ray through the map and is supposed to detect any "Block" category sprites (the trees), but never detects any. What am I doing wrong? I've also tried the same code using groups rather than categories and SpriteRayCastCategory/Group rather than PhysicsRayCastCategory/Group with the same results.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Aug 2016 17:14
You need to set the sprite up as a physics sprite IE. SetSpritePhysicsOn
Using AppGameKit V2 Tier 1
greycheek
8
Years of Service
User Offline
Joined: 13th Mar 2016
Location:
Posted: 30th Aug 2016 17:42
That did it! Thanks a bunch.

Login to post a reply

Server time is: 2024-04-19 08:27:10
Your offset time is: 2024-04-19 08:27:10