Discuss Scratch

Destroyer727
Scratcher
5 posts

Clone not deleting?

Alright so I have this code:
when I start as a clone
go to x: (0) y: (0)
point in direction ((direction V) + (pick random (-20) to (20)))
repeat until <touching [edge] ?>
move (20) steps
end
delete this clone

Everything works except the clone will not delete for some reason when it touches the edge.
can anyone help?

Last edited by Destroyer727 (July 14, 2021 00:42:16)

Wei-ern_520
Scratcher
500+ posts

Clone not deleting?

Can you send any link or anything? Also, might it be the problem that you have created too many clones at the same time?

Or you can try this

when I start as a clone
go to X (0) y (0)
point in direction ((direction V)+(pick random (-20) to (20)))
repeat until <<(x position)<(-240)>or <<(x position)>(240)>or<<(y position) <(-180)> or <(y position) > (240) >>>>
move (20)steps
end
delete this clone

Last edited by Wei-ern_520 (July 14, 2021 01:19:20)


Please consider checking out my suggestion ->here<-.

Hello, I’m Wei-ern_520, and I will randomly appear in your room! Just kidding, I make rpg engines.

I have no custom pfp, not because I don't know how to make one. I just don't know what suits me best, and I'm just too lazy and prefer sticking to simplicity. Or at least so. I also have the need to trip people with my profile picture. Just wait till it happens.

Fun fact: you don't clean your mess, you move it somewhere else. (Source: somewhere)

Also: Ooh, look at the cheese!
Paddle2See
Scratch Team
1000+ posts

Clone not deleting?

I'll move this over to the “Help With Scripts” section for you - that's a better fit for this kind of topic

Scratch Team Member, kayak and pickleball enthusiast, cat caregiver.

This is my forum signature! On a forum post, it is okay for Scratchers to advertise in their forum signature. The signature is the stuff that shows up below the horizontal line on the post. It will show up on every post I make.
(credit to Za-Chary)



;
Thingied
Scratcher
1000+ posts

Clone not deleting?

There doesn't seem to be anything wrong with the code so I think you should link the project. Asking questions 24/7 isn't very efficient.
Destroyer727
Scratcher
5 posts

Clone not deleting?

Wei-ern_520 wrote:

Can you send any link or anything? Also, might it be the problem that you have created too many clones at the same time?

Or you can try this

when I start as a clone
go to X (0) y (0)
point in direction ((direction V)+(pick random (-20) to (20)))
repeat until <<(x position)<(-240)>or <<(x position)>(240)>or<<(y position) <(-180)> or <(y position) > (240) >>>>
move (20)steps
end
delete this clone

The link is https://scratch.mit.edu/projects/553022860/
also I tried the code and it did not work.

Last edited by Destroyer727 (July 15, 2021 00:37:32)

Thingied
Scratcher
1000+ posts

Clone not deleting?

when I start as a clone
show
go to x: (0) y: (0)
point in direction ((direction V)+(pick random (-20) to (20)))
repeat until <<([abs v]of(x position))=(240)>or <([abs v] of(y position)) = (240) >> // The absolute of something is the positive version of it
move (20)steps
end
delete this clone
If the costume is too small, scratch will think the hitbox doesn't exist. If the hitboxes doesn't exist, it can't sense anything.

Last edited by Thingied (July 15, 2021 00:41:17)

Powered by DjangoBB