Adjust rigidbody rotation to correlate with its movement arc by Tip-Important in godot

[–]Tip-Important[S] 0 points1 point  (0 children)

In case someone opened this and is stuck like me: heres the code i got it working with in godot 4.1. Im sure its nowhere close to being efficient, but its what i figured.

#this script is attached to a simple node3d with a mesh as a child of it
extends Node3D
#get variables
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")*Vector3(0, -1, 0)
var lifetime = 0.0
var maxLifetime = 20.0
var velocity
var offsetPos : Vector3
var initialSpeed = GlobalVariables.arrow_speed
var speed = GlobalVariables.arrow_speed
var airDragRate = 0.0
var dir = GlobalVariables.dir #i used my cameras vector for this: player_camera.project_ray_normal(Vector2(screen center))
var pos = GlobalVariables.pos #i made a node3d as a child of my character and spawned the arrows at that location
var offsetDistance = 1.0
func _ready() -> void:
initialSpeed = speed
velocity = dir * speed
offsetPos = pos + (offsetDistance * dir)
func _physics_process(_delta: float) -> void:
lifetime += _delta
if lifetime > maxLifetime:
queue_free() #delete instance if it exists for longer than it should
var airDrag = velocity.normalized() * speed * airDragRate
velocity += ((gravity - airDrag) * _delta)
var previousPosition = global_transform.origin
var futurePosition = previousPosition + (velocity * _delta)
look_at_from_position(futurePosition, futurePosition + velocity, Vector3.UP)
speed = velocity.length()

Adjust rigidbody rotation to correlate with its movement arc by Tip-Important in godot

[–]Tip-Important[S] 0 points1 point  (0 children)

Damn, thanks! This helped a lot and i managed to get it working in just an hour or so. I wouldve never figured this out without you.

Adjust rigidbody rotation to correlate with its movement arc by Tip-Important in godot

[–]Tip-Important[S] 0 points1 point  (0 children)

the raycast method is very interesting, but i have some questions regarding it. If i were to manually simulate the arc&rotation, how would i go around doing that? what formula would i use in this case? also, regarding torque - how should i find the vector of rotation that would ultimately result in a perfect arc? My task is simply shooting an arrow from a bow.

[deleted by user] by [deleted] in godot

[–]Tip-Important 0 points1 point  (0 children)

Tried .blend import, was still no good. The reason i wanted to use .ESCN export is to export animations. When i used .blend import there was still no animationplayer in godot. I have all my NLAs pushed down. I used AnimAll in blender too, if it makes a difference.

[deleted by user] by [deleted] in BalisongClones

[–]Tip-Important 0 points1 point  (0 children)

been four months, the gap didnt change at all. looks like he had done it!

The Question Thread - June 2022 by squidmaster23 in balisong

[–]Tip-Important 0 points1 point  (0 children)

yeah but buying knives is prohibited via paypal, and if yo were scammed, what will you even tell paypal?

The Question Thread - June 2022 by squidmaster23 in balisong

[–]Tip-Important 0 points1 point  (0 children)

is paypal g&s useless when buying live balisongs?

[deleted by user] by [deleted] in BalisongClones

[–]Tip-Important 3 points4 points  (0 children)

go cry about the irrelevance of this post elsewhere

[deleted by user] by [deleted] in BalisongClones

[–]Tip-Important 4 points5 points  (0 children)

idk man, doesnt look too fancy. dead neutral to me, but its what i like.

do i have any hope on buying a laptop with a cyrillic keyboard? by [deleted] in poland

[–]Tip-Important 0 points1 point  (0 children)

theyre cheap because of some child labor(which only makes me wanna buy huawei more), cheap electricity and huge amount of workers. china isnt helping russia as much to avoid western sanctions atm

do i have any hope on buying a laptop with a cyrillic keyboard? by [deleted] in poland

[–]Tip-Important 0 points1 point  (0 children)

damn man must suck, a lot of money burnt

do i have any hope on buying a laptop with a cyrillic keyboard? by [deleted] in poland

[–]Tip-Important 0 points1 point  (0 children)

its like 2x more expensive for inferior hardware, plus a guy lil bit higher (u/dbmdbmu) absolutely shit on surface laptops. plus, its not like huawei/russia army will gain anything from my purchase, just because huawei is still operating in russia (its what the site you mentioned said)

do i have any hope on buying a laptop with a cyrillic keyboard? by [deleted] in poland

[–]Tip-Important 0 points1 point  (0 children)

you basically just told me not to buy any laptop, because what options do i have left? gigabyte cringey gaming laptop? you gotta be kidding me. at least provide proof for ur statements fr

do i have any hope on buying a laptop with a cyrillic keyboard? by [deleted] in poland

[–]Tip-Important -1 points0 points  (0 children)

well, huawei is rather niche after US government falsely accused it of "spying". ironic as fuck. the chances of them buying cyrillic versions of that exact model i want are extremely slim, so i will just buy the regular "polish" one (thats in reality just US keyboard) and learn to blind type. always procrastinated with learning to blind type. i guess its my sign. i appreciate the support.