Skip to content

Cable chaos when attached to a picked pickable #959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
Timmy-the-nobody opened this issue Sep 3, 2023 · 2 comments
Closed
2 tasks done

Cable chaos when attached to a picked pickable #959

Timmy-the-nobody opened this issue Sep 3, 2023 · 2 comments
Assignees
Labels
bug Something isn't working fixed Fixed or Implemented!

Comments

@Timmy-the-nobody
Copy link

Timmy-the-nobody commented Sep 3, 2023

Prerequisites

  • I'm sure both client and server are on the latest update.
  • I have read the console error message carefully (if applicable).

Your Environment

  • Version: 1.60.0
  • Operating System: Windows 11

Description

When attaching a cable between a picked pickable and a prop the prop will become crazy and teleport in a random position (near the center of the map I think)

Steps to reproduce the behavior

1: Run the snippet bellow with sandbox gamemode (and make sure at least 1 prop is spawned)
2: Pickup any sandbox tool to create a constraint between the tool muzzle and the first prop found
3: Contemplate the chaos

ToolGun.Subscribe("PickUp", function(self, eChar)
    for _, eProp in ipairs(Prop.GetAll()) do
        local eConstraint = Cable(eProp:GetLocation(), true)
        eConstraint:SetLinearLimits(ConstraintMotion.Locked, ConstraintMotion.Locked, ConstraintMotion.Locked)
        eConstraint:SetAngularLimits(ConstraintMotion.Locked, ConstraintMotion.Locked, ConstraintMotion.Locked)

        eConstraint:AttachStartTo(self, Vector(), "muzzle")
        eConstraint:AttachEndTo(eProp)
        break
    end
end)

Expected behavior

It should be constrained the same way as if the attach start actor wasn't a pickable

Actual behavior

C H A O S

chaos

@Timmy-the-nobody Timmy-the-nobody added the bug Something isn't working label Sep 3, 2023
@gtnardy
Copy link
Member

gtnardy commented Sep 4, 2023

image

@Timmy-the-nobody Timmy-the-nobody mentioned this issue Jan 1, 2024
2 tasks
@gtnardy gtnardy self-assigned this Apr 24, 2025
@gtnardy gtnardy added the fixed Fixed or Implemented! label Apr 24, 2025
@gtnardy
Copy link
Member

gtnardy commented Apr 24, 2025

The issue is that this bone doesn't exist on the Tool mesh, and I figured that Cables only accepts attaching to Bones (not socket).

I added an internal validation so for those cases it will give an error on client side and will attach to root bone instead.

Also I'm adding some new logic for when picking up Pickables, any attached cable will detach/destroy automatically (as already happens when a Character enter a vehicle), as Cables require the objects to simulate physics to work.

@gtnardy gtnardy closed this as completed Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Fixed or Implemented!
Development

No branches or pull requests

2 participants