#Issue with moving a player toward a point

1 messages · Page 1 of 1 (latest)

hexed glade
#

I have a fan that's supposed to suck players in, so I'm moving them towards it by adding velocity in its direction. The drawing shows the issue; instead of being pulled directly toward the object, the player gets pulled along the floor, then once no longer moving and directly under it, pulled up.

How can I get it to look more like the green arrow? Thanks!

somber thorn
#

@hexed glade

hexed glade
somber thorn
#

give me a sec i gotta fink

gritty pulsar
#

I’m pretty sure it takes a bit more force to get the player initially unstuck from the ground, you could try adding 9.81 • Delta Time to the Y coordinate of the direction

#

It’s been a while since I’ve messed with velocity, so please do take this with a grain of salt

somber thorn
hexed glade
#

I'm not fully sure what you mean, though, but I'm thinking if the Y value is under 1, or something, adding a little extra to the velocity

hexed glade
hollow cove
#

is that

#

basically all of that can be replaces by a single subtract and a single vector3 clamp magnitude

somber thorn
#

If you trying to move a player towards the fan

Fan pos - Player pos

then normalize it

That’ll give you the direction to the fan, not whatever Player - Fan inverse method you got going

If you trying to make the strength stronger as you go closer

Max distance - distance

then divide that by max distance

example

75 - (player distance from fan)

then divide that output by 75

#

@hexed glade

gritty pulsar
# hexed glade I'm not fully sure what you mean, though, but I'm thinking if the Y value is und...

I would also do what Ardenis is saying as there’s a lot of unnecessary steps in what you’ve currently got, but to better explain what I was saying:
9.81 = rec rooms G-force for players I believe
If you multiply that by delta time and add that number to the Y value of the direction, then that should counter the pull of gravity that’s keeping them further down, and give you more of a straight line

#

You may also want to divide 9.81 • Delta Time by your Multiplier before adding it to the directional vector. The Y value will still be multiplied, but the added force to get them off the ground will not

hexed glade