Collision detector?
Blitz3D Forums/Blitz3D Beginners Area/Collision detector?
| ||
Hello, sorry to for more questions. But how to make collision detector? I would like when player walk to non accessible room, the camera (player) collision to cube then say something? And by the way, how to make a cube invisible? Thank you for your time reading this. |
| ||
Not really sure what you're asking on the collisions part - is it that you just don't know how to make collisions work at all? As for making a cube invisible; EntityAlpha cube,0 if you want collisions to still be performed on it, or HideEntity cube if you don't. |
| ||
I have collision working just fine;type_camera = 2 type_barrier = 5 camera = CreateCamera() CameraClsColor camera,0,0,0 PositionEntity camera,0,2.0,0 CameraFogRange camera,1,30 EntityType camera,type_camera EntityRadius camera,2,1.2 EntityPickMode camera,1 barrier = CreateCube() PositionEntity barrier,-6.5,1,-2 EntityType barrier,type_barrier EntityRadius barrier,1 Collisions type_camera,type_barrier,1,5 But how to make a collision detector when camera hit cube and say "I am not suppose be here" etc. |
| ||
Use the entitycollided command.... example.. if entitycollided(entity(moving),entitytype(in this case the barrier)) then playsound or print text |
| ||
I've tried but it appear "Expecting 'Wend'" What is missing or wrong here? EntityCollided(entity(camera),EntityType(barrier)=1 Then Text 800,800,("I am not suppose be going here."),1,1 |
| ||
it should be If EntityCollided(camera,type_barrier) Then Text 800,800,("I am not suppose be going here."),1,1 |
| ||
It working now, thank to you (and GfK for invisible cube). |