Upside-Down Movement for NPCs

Im making a horror game and i’m trying to make a npc that climbs upside down and (if possible) alternate between upside down, wall, and floor movement. But i mainly just want upside down movement.

Should I be using Velocity, CFrame, or what?

here’s a conceptual approach:

  1. CFrame Manipulation:

    • Use CFrame to position and rotate the NPC. To make the NPC appear upside down, you would modify its CFrame to flip it over. This involves rotating the NPC’s orientation by 180 degrees along the X-axis.
  2. Movement Logic:

    • You’d implement a system that determines how the NPC moves in different orientations (upside down, on walls, and on the floor). This might include defining separate movement patterns for each state.
  3. State Management:

    • Establish a state machine that allows the NPC to switch between different movement states (e.g., upside down, on a wall, or on the floor). Depending on conditions in the game (like player proximity or environmental features), the NPC would transition between these states.
  4. Gravity and Physics Considerations:

    • If your game uses physics (for realistic interactions), consider how gravity affects the NPC. When upside down, you might need to adjust its physics properties or temporarily disable gravity to create a convincing effect.
  5. Animation and Visual Feedback:

    • To enhance the experience, you could incorporate animations or visual effects that correspond with the NPC’s movements. For example, changing the NPC’s animation when it switches from walking upside down to crawling on the floor can make the transitions feel smoother.
  6. Trigger Events:

    • Implement events or triggers to facilitate state changes. For instance, if the player comes within a certain range, the NPC could automatically switch from walking on the floor to climbing upside down.

thanks ChatGPT

ai-user-spotted

3 Likes

bruh, are there any human reccomendations for what i should be doing?

i’ve never made npcs that stick to walls, maybe u should look into that gravity controller made by egomoose(?)

1 Like

that works pretty well but i want to make my own script for it thats customized for my game, i just want to know what i should be using to make something like that, and i just don’t really feel like downloading files n stuff.

You would probably need to inspect the Roblox player modules to see how it moves the character around to even get the basic npc going.

Since gravity is just a force applied on the NPC, Theoretically, all you need to do is to apply a VectorForce double the gravitational force (workspace,gravity * the NPC’s assembly mass) but in the +y direction. That should give the npc “upside-down” movement provided you account for and handle its rotation too.

edit: In practice, just double the gravitational force might not be enough as humanoids don’t like leaving the ground, try 15-20k to cancel out gravity and then increase it to your preferred one from there.

1 Like