Need help on 173

Hi, so I am working on my multiplayer SCP game. I need SCP 173 to not move when the player is directly facing it, but to move super fast when not. I cannot use raycasts since they don’t turn. Please help!
meburningslime :slight_smile:

Raycasts can turn, but you have to turn it by the behavior.
Could you leave a link to the game?

flowlab.io/game/play/1364698

Maybe something like this,
I know the thing moves in a blink of an eye and moves when you don’t look at it. So I made the movement represent that. I’m using forward to move 173 but doing that ignores walls, so instead of point at, you could use a 4 way raycast to see where a wall is and move in the general direction that is closer to the player.

But here’s how you can rotate the raycast and a good movement for 173:

Player:
2020.05.11-18.59

173: (Timers are 10 w/repeat of forever and 1 w/repeat of 1)
2020.05.11-19.09

Refresh and try it

You mentioned using raycasts for pathfinding? Could you tell me how? Sorry it’s been a while since iv’e coded. :frowning:

That’ll be a little tough and you would have to throw out the Point-At behavior.
From what I can think of, there are 2 ways to do this.

  • Have 4 Raycasts for up, down, left, right and output them to Switches
  • Get the Player’s X and Y values from a mailbox
  • Use This X and This Y and compare it with the player by using Filters
    (The Filters will give a general direction to fin the player)
  • Use another set of filters to compare the X and Y
    (Example: If Y is closer, go down. If X is closer go right.)
  • Make the filters turn on/off the Switches
  • If the Raycast doesn’t see any walls turn into the direction that is closer to the player
  1. If the walls aren’t 4 directions (like an open room).
  • Have 3 raycast with rotations of Forward, Forward-left, Forward-right (+270, +225, +315)
  • Get the Player’s X and Y values from a mailbox
  • Use the Angle-To bundle in my examples
  • Rotate into the direction of the player (given by the Angle-To bundle)
  • If the 2 side raycasts (+225 or +315) hit a wall, rotate until forward (+270) doesn’t hit a wall
  • When no raycast hits a wall rotate to the direction of the player


I’ll try. Btw, read my mind blowing discovery on the other forum post. You will find it amazing