#whats the word / function to give an unanchored part force so it moves in a direction?

33 messages · Page 1 of 1 (latest)

supple magnet
#

if you also know the math to make something go forwards, that would be appreciated (if thats necessary)

elder wind
#

I assume you want to use roblox physics?

Insert an attachment to the BasePart you want to move forward
Insert a LinearVelocity Instance also to the BasePart and set its following properties:
Set RelativeTo to Attachment0
Set VelocityConstraintMode to Line
Set Attachment0 to the attachment you created

And then fiddle with the other properties until satisfied. Make sure the attachment is facing the correct direction too.

supple magnet
#

yeah i do i think

elder wind
supple magnet
#

thanks bro

elder wind
#

Np my man. hope you found what you're looking for 🤝

supple magnet
#

im trying to make a kick door kinda thing if you were curious

#

so plays an animation after hitting a key then the door unanchors and moves

elder wind
#

ah

supple magnet
#

while you're here @elder wind do you know how i can define the player character in a server script

#

i cant find a single tutorial on devforum or youtube that tells me somehow

elder wind
#

There are a few ways of going about it

What will be your use-case?

supple magnet
#

to uh

#

get the character and when it touches a specific invisible hitbox i can then run a findfirsthumanoidwhichisa check

#

to then allow a keybind to work

#

i think?

#

im not a good scripter mind i only recently got the hang of very basic scripting

elder wind
#

All good, let me whip up an example

supple magnet
#

we can go in dms if you want but if you'd rather stay here thats all good

elder wind
#

Server Script

local HitboxThing = game.Workspace.HitBoxThing
HitboxThing.touched:Connect(function(Hit)
    if not Hit.Parent:FindFirstChildWhichIsA("Humanoid") then return end -- If it's not/there is no humanoid, then end function
    local Character = Hit.Parent
    local Plr = game.Players:GetPlayerFromCharacter(Character) -- Get Player Instance from their Character Model
    if not Plr then return end -- If it's not/there is no Player, then end function
    -- Do whatever you want from here since Character is now confirmed to be a Player's character.
end)
#

@supple magnet ⬆️

supple magnet
#

aight

#

ok thanks man

#

can i add you

#

im tryna add people that can script to just get better yk

#

i figured surrounding myself in people who can script would be beneficial

#

not just cuz they can script tho, most scripters are really chill people

elder wind
#

That's a pretty neat idea lol, sure thing!
User is GohanDucis

supple magnet
#

on discord i meant

elder wind
#

ah lol

supple magnet
#

probably should have specified

#

if you dont wanna add me on discord thats fine

#

i can just add you on roblox