Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Collision script hep for overhead shooter
- NooblyTehNoob123
- Scratcher
12 posts
Collision script hep for overhead shooter
How do i make it so when my zombie and character touch, the don't float into each other. there collide like modern video games (collision does not need to be perfect, com be a few cm away). Please help
- PH-zero
- Scratcher
100+ posts
Collision script hep for overhead shooter
Make 2 new objects that follow your character. A right sensor, and a left sensor.
Custom editor:
just draw a blck box for example for the right sensor you don't put it in the center, instead a little bit to the right.
same for left.
Scripts on right sensor:
when GF clicked
set ghost effect to 99
forever
go to “Player”
if button “right arrow” pressed AND NOT touching “Zombie” then
change x position by “5”
/if
/forever
same for left:
when GF clicked
set ghost effect to 99
forever
go to “Player”
if button “left arrow” pressed AND NOT touching “Zombie” then
change x position by “-5”
/if
/forever
Scripts on zombie:
when GF clicked
forever
if player-x-position > x-position AND NOT touching “Player” then
change x by “5”
/if
if player-x-position < x-position AND NOT touching “Player” then
change x by “-5”
/if
/forever
these are just very simple examples.
Hope that heples
Custom editor:
just draw a blck box for example for the right sensor you don't put it in the center, instead a little bit to the right.
same for left.
Scripts on right sensor:
when GF clicked
set ghost effect to 99
forever
go to “Player”
if button “right arrow” pressed AND NOT touching “Zombie” then
change x position by “5”
/if
/forever
same for left:
when GF clicked
set ghost effect to 99
forever
go to “Player”
if button “left arrow” pressed AND NOT touching “Zombie” then
change x position by “-5”
/if
/forever
Scripts on zombie:
when GF clicked
forever
if player-x-position > x-position AND NOT touching “Player” then
change x by “5”
/if
if player-x-position < x-position AND NOT touching “Player” then
change x by “-5”
/if
/forever
these are just very simple examples.
Hope that heples
- NooblyTehNoob123
- Scratcher
12 posts
Collision script hep for overhead shooter
ok ill true my best, ill ask if it dont work out
- Discussion Forums
- » Help with Scripts
- » Collision script hep for overhead shooter