Sit to click bricks, are they possible?

Oh, I just put it in a LocalScript inside of StarterCharacterScripts. You can change the location wherever you prefer tho.

Oh right, the code works great! but is it possible to achieve something like this:
image
Without actually using a seat either, it’s a little tricky to explain but i hope that explained it better

Yup it’s definitely possible but may I ask why you don’t wanna use easier methods like ClickDetector and seats?

Just want to try something a little different for once :smile:
I was randomly thinking one day and this came into my mind, but i’m obviously not the best coder in the world, so i thought i’d ask here instead! hope it doesn’t bother you

Oh alright. Well, you can use WeldConstraints for this. Teleport the player to the “seat” brick:

Character:SetPrimaryPartCFrame(Seat.CFrame)

However, this would make the character go inside of the seat, which we don’t want so:

Character:SetPrimaryPartCFrame(Seat.CFrame * CFrame.new(0, Character.PrimaryPart.Size / 2, 0)

Now, we only need to weld the character to the seat:

local Weld = Instance.new("WeldConstraint")
Weld.Part0 = Character.PrimaryPart
Weld.Part1 = Seat
Weld.Parent = Character.PrimaryPart
Weld.Enabled = true

Why weld constraints? Cause they don’t move the Part0 towards Part1.

No problem, I’m bored anyways so it’s always good to help people instead of doing nothing.

Do you think you would be able to provide a sample of what the full code for this would look like? as i said i’m not the best programmer, and thanks for being really helpful so far! i do appreciate it!

1 Like

It’s actually pretty easy, just combine everything I gave you togheter into a normal LocalScript. Is something confusing you in the script I provided? If so you can tell me so I can explain you.

No no it’s just putting it together that’s a tad confusing for me, thats all!

If you could, can you possibly provide a sample/full code for this please? i know i sound a bit beggarish but i’m not trying to be, thanks!

Sure, can you give me some time tho I’m finishing something for my game. I’ll give you the code when I’m done with everything.

Sure! i’ll wait however long it takes, thanks man!

1 Like

Do you mind if I send you a place directly instead of just giving the code? This way you can try it out by yourself. I’ll also add some comments so you can understand the pieces of code.

Sure! i don’t mind! a place is fine!

Alrighty, give me 5 minutes then so I can script it all and add comments as I said.

Oki doki! thank you so much! i cant express how thankful i am!

Here you go:
Sitting (No ClickDetectors and Seats).rbxl (35.6 KB)
Sorry if it took me a while more but I didn’t think about all the testing and possible errors that I was going to encounter. 5 minutes was too low anyways lmao.

1 Like

That’s perfect! it’s exactly what i needed! just 1 last thing, is it possible so when you’re sitting in a seat, you can only sit in another seat if you hop out the one you’re sitting in? apart from that it’s perfect!

1 Like

Oh sure you can. In the lines where I check if there already is another WeldConstraint (under the Target block not JumpRequest), instead of destroying the already existing weld and setting Humanoid.Sit to false, return the function.

works! thanks so much! this is so helpful!

1 Like

Ah… there is just 1 more thing before i stop posting on this thread
Is it possible to make an FE version? at the moment it’s Non-FE which is a bit of a bugger