Im making a portal game like portal 2 and ive been wondering how i am going to make it so when clicked your mouse, a portal appears and when you walk into it you teleport to the other colour portal. Does anyone know how to help?
Offline
This script can go for any sprite
When gf clicked Forever if <mouse key clicked> Broadcast [whatever v] Stop scriptnow put this script in the portal sprite
When I receive [whetever v] Shownow this next script goes in the sprite that will be walking into the teleporter
When I receive [whatever v] Forever if <touching [the portal v]> Go to [the other portal]This should work except I don't know of you can make it "if mouse key clicked"
Last edited by turkey3 (2012-03-11 10:00:57)
Offline
thanks it works but the only problem is that the sprite gets stuck, should i make it bigger? would that help?
Offline
I can help
when gf clicked forever if [touching portal v] go to [portal 2 v] repeat until [not touching portal 2 v] move [10] stepsUse turkey 3's mouse click thing. But all you need to do is put in both the portals's scripts,
if [mouse down?] show
Offline
@DaScratcher101
That only works if you're facing away from the portal when you're in the portal. Otherwise, you could end up moving into the wall! While I was making my portal game, I found it necessary to know the direction of each portal, do calculate velocity changes and make the sprite not be stuck in a wall.
Offline