Basically I want a part to be launched upwards, then fall back down. Simulating a part “jumping”. I have tried using BodyForce, BodyVelocity and Velocity but none of them worked or I just didn’t use them correctly. Any help is very appreciated.
You may want to look at tween service. It does wonders
Tween service, there is a specific animation I think that looks like this. When setting the easing style there are many options and I recommend making the tween then trying out the different kinds to achieve what you want.
Maybe you can try this:
local part = workspace.part local startpos = part.Position while (true) do wait() part.Position = startpos + Vector3.new(0,math.sin(tick()),0) end
I didn’t really want to use tween service since I was using tween service for something else.
Could you tell us why. Is it due to performance etc?
BodyVelocity seems to work for me, maybe the part is just anchored? or welded to an anchored part?
Tween service doesn’t really have physics and moves up and down, so it could essentially tween through a part.
Could you provide a uncopylocked game or source code because I am dumbfounded on how to accomplish that.
I was looking more for a one time thing and not a repeated up and down cycle.
Use constraints, specifically prismatic constraints. You can learn more about them here: https://developer.roblox.com/en-us/api-reference/class/PrismaticConstraint
How would constraints help with moving it up and down?
So I have a model inside one of my games which is a shoving platform.
You can check out the model. Although it doesn’t move up and down, you can change it to how you want it. I recommend going into the prismatic constraint’s properties, change the speed to how you want it and the force. Analyze the model and try to understand the code. Hope this helps.
Here is a video teaching you how to make an elevator that goes up and down using prismatic constraints and scripts:
Edit: You can change the start part and end part positions.
Thanks for this but it doesn’t really help for what I am trying to achieve. I am looking for a simple way of making an going up and down simulation.
you can do
local heightVelocity = 100 part.Velocity = Vector3.new(0, heightVelocity, 0)
When I put that in there, it doesn’t propel upwards but instead propelled my character upwards.
is the part a children of the character or touching it in some ways? if not try applying the velocity to an unanchored newly created part and see if it works fine then, if it does the problem might be because of the way you set up the part
It is not a child of character and I just added it into workspace? I don’t think that should interfere with how it reacts.
strange, here’s a placefile of a working implementation, see if you can find out what’s wrong with your current one velocity.rbxl (20.8 KB)
Thank you so much! This seemed to work and I have absolutely no idea what I did wrong. Thanks!!