#Throwing rigidbodies

3 messages · Page 1 of 1 (latest)

wise cosmos
#

Hi, im trying to throw rigidbodies in my 3d project , I use a kinematic body player with a raycast to pick up the rigidbody but when i release the button the object just falls straight down with no momentum.
My code:
if Input.is_action_pressed("punch"):
if ray_cast_3d.get_collider():
held_object = ray_cast_3d.get_collider()

    if held_object:
        held_object.global_transform.origin = hold_position.global_transform.origin

Do I have to add an impulse when I release the "punch" button or is there another way?

feral roseBOT
#
Embedding code in discord messages
Inline Code

When you surround some words with single backticks like `this`, it will be formatted as code.

Code Blocks

You can also include code blocks by surrounding the code with three backticks. If you add "swift" then you will also get basic syntax highlighting:
```swift
print("hello world")
```
Discord will then show it as a code block like this:

print("hello world")
Upload

If your code snippet is rather long, you can upload it to a text paste site. One option that supports syntax highlighting for GDScript is https://bpa.st/

turbid sandal
#

Yep, impulse is the way to go. Or you could even set the velocity directly in this case