I need help! (TD GAME)

So basically im making a td game and i dont have a enemy sprite yet but thats not my point when i have the enemy colide with a block to add rotation it grinds up against the wall but iw ont it to stay centered on the track the entire time any ideas

4 Likes

image

2 Likes

vs what i want through the entire track image

2 Likes

im thinking :thinking:

3 Likes

maybe try some complex code like:
Make it move for a certain amount of time and then when that time is done it moves before it hits the wall

3 Likes

Check out my game if you need help:

1 Like

that didnt help

2 Likes

How not? It has all the code in the enemy…
image

1 Like

Hey there!

Your issue is happening because the object has room to move forward from the wall and isn’t a proportioned square like the other objects. The best way to fix this is to use a ray cast instead of a collision.

2 Likes

thank you so much i will try my best to fix this error

2 Likes

how would i do something like this because i just cant wrap my head around it @DinoDev

2 Likes

Create an always. Create a raycast. Set the raycast to the object you would like to collide with, then select your desired length and angle. Connect the hit of the raycast with whatever you want to be activated.

2 Likes

Example? @hihilogic or @DinoDev

2 Likes

I’ll give you one later.
In algebra rn

2 Likes

ok thank you @hihilogic

2 Likes

umm

2 Likes

Nvm. Don’t use my example. Just use @JR_01’s example :upside_down_face:

1 Like

he has one?

2 Likes

Yea…

1 Like

I think the easiest solution is to make the turn blocks bigger, the issue with your current setup is that they grind on the walls after turning right? Either do this in the sprite editor or with the size % block.

You can use my system instead, but it is a bit advance to use.

2 Likes