Discuss Scratch

MustashManStudios
Scratcher
35 posts

Lightsaber glitch

I am making a lightsaber combat mechanic, and here is the code for particles.

when I start as clone
go to player saber
point in direction of player saber
repeat untill touching enemy saber (move 10 steps)
show
next costume
point in direction -179 to 180
repeat 10
move 10
delete clone

The Problem is it does not show when touching enemy saber, but when i have it forever show it works, but you can see the particles moving up the hilt.
Any ideas why?
Help me please its here https://scratch.mit.edu/projects/669374433/
You are my only hope
mistafl00py
Scratcher
51 posts

Lightsaber glitch

When you hide a sprite, it's unable to sense other sprites. To get around this, simply use “set ghost effect” instead.
MustashManStudios
Scratcher
35 posts

Lightsaber glitch

Thank you so much, I knew that when hidden it loses its sensing, I just forgot because I was in a rush. Thanks!
mirrorknight01
Scratcher
5 posts

Lightsaber glitch

MustashManStudios wrote:

Thank you so much, I knew that when hidden it loses its sensing, I just forgot because I was in a rush. Thanks!

Also if you set ghost effect to 100 it will act same as it is hidden so make sure to set ghost effect to 99 instead.
Jlerpy
Scratcher
1000+ posts

Lightsaber glitch

mirrorknight01 wrote:

MustashManStudios wrote:

Thank you so much, I knew that when hidden it loses its sensing, I just forgot because I was in a rush. Thanks!

Also if you set ghost effect to 100 it will act same as it is hidden so make sure to set ghost effect to 99 instead.

I don't think that's true.
*tests*
That is indeed incorrect. Sensing works fine at Ghost 100.
Jlerpy
Scratcher
1000+ posts

Lightsaber glitch

So yeah, if you give it a
setGhosteffectto100
then after the collision detection, a

setGhosteffectto0

that works great.

I'd also suggest, before the repeat until move, putting in a single move of about 50, which jumps the particles past the hilt. This means they won't spark if the other lightsaber manages to touch the hands or the hilt, AND speeds them up so there's not as much of a lag between the blades touching and the sparks appearing.
MustashManStudios
Scratcher
35 posts

Lightsaber glitch

Also thanks!

Powered by DjangoBB