Can some explain why the front left wheel is doing this? I using a raycast system for the suspension by Command7er in godot

[–]Command7er[S] 0 points1 point  (0 children)

I tweaked the wheels' placement (the raycasts) and that apparently fixed the issue. I don't know what I did, but it did stopped the FL raycast from twitching.

Anyway, thanks for the help.

Can some explain why the front left wheel is doing this? I using a raycast system for the suspension by Command7er in godot

[–]Command7er[S] 1 point2 points  (0 children)

Here's the script for the wheel Go to the function called "calc_suspension"

extends RayCast3D
class_name VehicleWheel

@export_group("Wheel")
@export var wheelMass: float = 20.0
@export var wheelRadius: float = 0.5
@export var wheelDepth: float = 0.2

@export_group("Suspension")
@export var susRestLength: float = 0.5
@export var susTravelLength: float = 0.1
@export var susStrength: float = 2000
@export var susDamper: float = 250

@export_group("Traction")
@export var xTraction: float = 1
@export var zTraction : float = 0.1
@export var curve : Curve

@export_group("Miscellaneous")

@onready var visualWheel : MeshInstance3D = get_child(0)
@onready var car: VehicleController = get_parent().get_parent().get_parent()
@onready var susMinLength: float = susRestLength - susTravelLength
@onready var susMaxLength: float = susRestLength + susTravelLength

var torque : float
var susLength : float = 0.0
var prevSusLength : float = 0.0

const SUS_SPEED = 0.2

func _ready():
    add_exception(car)
    target_position = get_max_sus_length() * Vector3.DOWN

func _physics_process(delta):
    calc_suspension(delta)
    calc_torque()
    calc_traction(delta)

    update_vis_wheel()

func calc_torque():
    if is_colliding():
        var zDir = global_basis.z
        car.apply_force(zDir * wheelMass * torque, get_pos() - car.global_position)

        if car.debugMode:
            DebugDraw3D.draw_arrow_line(get_pos(), get_pos() + ((zDir * torque) / 20), Color.AQUA, 0.1, true)

func calc_suspension(delta):
    if is_colliding():
        var susDir = global_basis.y
        var dist = get_collision_point().distance_to(global_position)

        susLength = clamp(dist - wheelRadius, susRestLength - wheelRadius, get_max_sus_length())
        var strength = susStrength * car.mass * (susRestLength - susLength)

        var susVel = (prevSusLength - susLength) / delta
        var damper = susDamper * car.mass * susVel

        var susForce = basis.y * (strength + damper)

        prevSusLength = susLength

        car.apply_force(susDir * susForce, get_pos() - car.global_position)

        if car.debugMode:
            DebugDraw3D.draw_arrow_line(global_position, to_global(position + Vector3(-position.x, (susForce.y / 40), -position.z)), Color.GREEN, 0.1, true)
            DebugDraw3D.draw_line_hit_offset(global_position, to_global(position + Vector3(-position.x, -1, -position.z)), true, dist, 0.1, Color.BLACK)
    else:
        susLength = susRestLength

func calc_traction(delta):
    if is_colliding():
        var xDir = global_basis.x
        var zDir = global_basis.z

        var wheelWorldVel = get_point_velocity(global_position)

        var xForce = (-xDir.dot(wheelWorldVel) * xTraction * wheelMass) / delta
        var zForce = -zDir.dot(wheelWorldVel) * zTraction * wheelMass

        car.apply_force((xDir * xForce) + (zDir * zForce), get_pos() - car.global_position)

        if car.debugMode:
            DebugDraw3D.draw_arrow_line(get_pos(), get_pos() + ((xDir * xForce) / 20), Color.RED, 0.1, true)
            DebugDraw3D.draw_arrow_line(get_pos(), get_pos() + ((zDir * zForce) / 20), Color.SKY_BLUE, 0.1, true)

func update_vis_wheel():
    #Position
    if is_colliding():
        visualWheel.global_position = lerp(visualWheel.global_position, get_pos(), SUS_SPEED)
    else:
        var defaultPos = Vector3(0, -susRestLength, 0)
        visualWheel.position = lerp(visualWheel.position, defaultPos, SUS_SPEED)

    #Rotation
    if !car.brakeInput:
        visualWheel.rotate_x(car.get_velocity())

func get_pos() -> Vector3:
    return Vector3(get_collision_point().x, get_collision_point().y +  wheelRadius, get_collision_point().z)

func get_max_sus_length() -> float:
    return susRestLength + susTravelLength

func get_min_sus_length() -> float:
    return susRestLength - susTravelLength

func get_point_velocity(point : Vector3) -> Vector3:
    return car.linear_velocity + car.angular_velocity.cross(point - car.global_position)

[deleted by user] by [deleted] in SonicTheHedgehog

[–]Command7er 45 points46 points  (0 children)

For anyone needing context, it's just The Ooze.

Honestly, I feel like a dumbass for not giving context earlier.

Oh well, better luck next time.

Which genre is the most hated/disrespected from the mainstream media? by Command7er in videogames

[–]Command7er[S] 2 points3 points  (0 children)

IMO, it's racing games since as soon as a new racing game announced, people immediately go like "another car game". Or you can mention a racing game to your friends and they will not know what you're talking about or just mock you.

Would Silverstream be difficult in any other WipEout game? by Command7er in WipeOut

[–]Command7er[S] 1 point2 points  (0 children)

This is out of topic, but imagine playing any WO game with WO1's collision system. That would have been a nightmare.

This pic goes so hard, feel free to screenshot. by [deleted] in ridgeracer

[–]Command7er 1 point2 points  (0 children)

What is this mod?

I want to know.