#How can I make players stick to moving parts?
1 messages · Page 1 of 1 (latest)
** You are now Level 1! **
As you can see the platform moves and I fall off
You can use AssemblyLinearVelocity,
Hello, I am trying to make a platform that slides back and forth, but the player keeps falling off. I want to make it so the player stays on while it moves. Here is the video: I tried looking through other solutions on the dev form, but they are all too complicated for me. Here is my code: local TweenService = game:GetService('Tw...
Its basically just a property of a basepart
In the video, he is tweening the part and all however, he is also changing the assembly linear velocity
by finding the offset for each heartbeat, and updating the speed depending on the distance the part moved
gl !
okay with the guide I got it to work :)
thanks
hey @warped turret do you maybe know how I could make more carts to the train?
I tried to somehow make the tween service set the CFrame of the 2nd platform to the main platform but it didnt really work
there was a huge gap between them
Can you show the code?
imma read it in a min
one sec
its probably because you're not tweening them at the same time
hmm
Yup @unkempt vigil you are waiting 1 second between each tween
oh but I noticed that if I tweened the cart to the main platform then when the main platform would stop the cart would just go into it
how do I avoid that?
one sec
just make sure there is always an offset
or like -1 position
of the part infront of it
if you're storing positions in a table
I'm not storing them in tables
** You are now Level 2! **
like the child number
how do I do that exactly? 👀
wait would it be a good idea to try adding an int value to the main platform and have the cart part go to the checkpoint that is -1 of the value?
Like right now you have number right for each cart?
like number 1
number 2
etc
yeah its for these things
and you have position in the folder?
yeah
but rn I'm storing them in the script only
that could probably work but I would need to add more points for the stations
Not really
Like I don't get what you are trying to achieve exactly
are the carts colliding with eachother
or are they colliding with the main platform itself
no its that I dont really know how to add carts to the train
and when I tried to do it there were huge gaps
Oh, look you're gonna tween them all the same time, however you're gonna tween them to position of the cart infront of them
so lets say the cart infront of them is at 20
the next cart will move at 20
the cart infront of it
will move to 21
and you decrement for each cart
but in your example
lets say the main cart is moving to 20?
ye
and lets say your train has 10 carts
the final cart would move to 10
but you must tween them all at the same time
but when the train would stop wouldnt the carts just go into one another?
no, because they would only move the old position of the cart infront it?
they would be always offseted by 1 checkpoint so to say
oh
could I achieve the same by making some sort of value in the 1st platform to the number and then have the carts go to the -1 of that value?
-1 the value of the cart infront it
np