Discuss Scratch

ECollins48
Scratcher
2 posts

Picking up Object

I am currently trying to make a portal game in scratch because I'm bored and want to pick up the companion cube, which I can do, but I also have it so the portal gun follows the direction of my mouse and I want the cube to follow the end of the gun, not just sitting there. How would I do that?
Elaver_3000
Scratcher
57 posts

Picking up Object

for the companion cube
forever
if <picked up> then
go to [portal gun v]
point towards [portal gun v]
turn cw (180) degrees //or you can use a CCW turn, it shouldn't matter at all
move (n) steps //n being any number, experiment with it to see what works.
end
end
You may need to tweak this to disallow prop flying if you're making it a platformer, you could also remove collision from it.
To have the portal gun follow the mouse, use a
point towards [mouse pointer v]
in a forever loop.

Powered by DjangoBB