<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[My CharacterController won&#x27;t fall]]></title><description><![CDATA[<p dir="auto">I have a CharacterController, gravity is -9.18 but it just doesn't want to fall.<br />
My code:</p>
<pre><code>import QtQuick
import QtQuick3D
import QtQuick3D.Helpers
import QtQuick3D.Physics

Window
{
    id: window
    width: 1920
    height: 1080
    visible: true
    title: "qt quick 3d"
    visibility: Window.FullScreen

    property real moveSpeed: 4

    Timer
    {
        interval: 16
        running: true
        repeat: true

        onTriggered: {
            let dir = control.wasdVector(player.eulerRotation.y)
            player.movement = Qt.vector3d(
                dir.x * moveSpeed,
                player.movement.y,
                dir.z * moveSpeed
            )
        }
    }

    View3D
    {
        anchors.fill: parent
        PhysicsWorld
        {
            id: physWorld
            gravity: Qt.vector3d(0, -100, 0)
            running: true
        }

        environment: SceneEnvironment
        {
            lightProbe: Texture
            {
                source: "sunny_rose_garden_2k.hdr"
            }
            backgroundMode: SceneEnvironment.SkyBox
        }


        CharacterController
        {
            id: player
            position: Qt.vector3d(0, 20, 0)
            gravity: physWorld.gravity
            simulationEnabled: true

            collisionShapes: CapsuleShape
            {
                height: 1.8
                diameter: 0.4
            }

            PerspectiveCamera
            {
                id: cam
                y: 1.8
            }
        }


        Model {
            source: "#Cube"
            id: floor
            materials: PrincipledMaterial
            {
                baseColor: "grey"
                metalness: 0.0
                roughness: 0.5
            }
            scale: Qt.vector3d(1, 0.01, 1)

            StaticRigidBody
            {
                collisionShapes: BoxShape {}
            }
        }
    }
    /*WasdController
    {
        controlledObject: cam
    }*/

    Timer {
        interval: 500
        running: true
        repeat: true
        onTriggered: {
            console.log(
                "pos.y =", player.position.y,
                "movement =", player.movement, "gravity =", player.gravity
            )
        }
    }

    MouseArea {
        anchors.fill: parent
        hoverEnabled: true
        focus: true
        acceptedButtons: Qt.AllButtons
        cursorShape: Qt.BlankCursor

        property real yaw: 0
        property real pitch: 0
        property real sensitivity: 0.2
        property real lastX: 0
        property real lastY: 0

        onPositionChanged: (m) =&gt; {
            // вычисляем дельту относительно центра
            let dx = m.x - width/2
            let dy = m.y - height/2

            yaw   -= dx * sensitivity
            pitch -= dy * sensitivity
            pitch = Math.max(-80, Math.min(80, pitch))

            cam.eulerRotation = Qt.vector3d(pitch, 0, 0)
            player.eulerRotation = Qt.vector3d(0, yaw, 0)

            // возвращаем мышь в центр
            control.setMousePos(width/2, height/2)
            lastX = width/2
            lastY = height/2
        }

        Component.onCompleted: {
            forceActiveFocus()
            control.setMousePos(width/2, height/2)
        }

        Keys.onPressed: (event) =&gt;
        {
            if(event.key === Qt.Key_W) control.onWPressed()
            if(event.key === Qt.Key_A) control.onAPressed()
            if(event.key === Qt.Key_S) control.onSPressed()
            if(event.key === Qt.Key_D) control.onDPressed()
            if(event.key === Qt.Key_Space) control.onSpacePressed()
            if(event.key === Qt.Key_Control) control.onCtrlPressed()
            if(event.key === Qt.Key_Shift) control.onShiftPressed()
            }
        Keys.onReleased: (event) =&gt;
        {
            if(event.key === Qt.Key_W) control.onWReleased()
            if(event.key === Qt.Key_A) control.onAReleased()
            if(event.key === Qt.Key_S) control.onSReleased()
            if(event.key === Qt.Key_D) control.onDReleased()
            if(event.key === Qt.Key_Space) control.onSpaceReleased()
            if(event.key === Qt.Key_Control) control.onCtrlReleased()
            if(event.key === Qt.Key_Shift) control.onShiftReleased()
        }
    }
}

</code></pre>
<p dir="auto">The c++ function <code>wasdVector</code> works as intended, so where's the problem?</p>
<p dir="auto">P.S. sorry if the code is messy</p>
]]></description><link>https://forum.qt.io/topic/164191/my-charactercontroller-won-t-fall</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Apr 2026 07:11:05 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164191.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 31 Jan 2026 15:41:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to My CharacterController won&#x27;t fall on Tue, 03 Feb 2026 19:43:54 GMT]]></title><description><![CDATA[<p dir="auto">solved, i didn't add <code>scene</code> property to <code>PhysicsWorld</code></p>
]]></description><link>https://forum.qt.io/post/835991</link><guid isPermaLink="true">https://forum.qt.io/post/835991</guid><dc:creator><![CDATA[Svyat]]></dc:creator><pubDate>Tue, 03 Feb 2026 19:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to My CharacterController won&#x27;t fall on Thu, 05 Feb 2026 09:21:05 GMT]]></title><description><![CDATA[<p dir="auto">Slightly off-topic: Maybe it's a typo, but Earth's gravity is 9.81 and not 9.18.</p>
]]></description><link>https://forum.qt.io/post/836030</link><guid isPermaLink="true">https://forum.qt.io/post/836030</guid><dc:creator><![CDATA[SimonSchroeder]]></dc:creator><pubDate>Thu, 05 Feb 2026 09:21:05 GMT</pubDate></item><item><title><![CDATA[Reply to My CharacterController won&#x27;t fall on Tue, 03 Feb 2026 19:43:54 GMT]]></title><description><![CDATA[<p dir="auto">solved, i didn't add <code>scene</code> property to <code>PhysicsWorld</code></p>
]]></description><link>https://forum.qt.io/post/835991</link><guid isPermaLink="true">https://forum.qt.io/post/835991</guid><dc:creator><![CDATA[Svyat]]></dc:creator><pubDate>Tue, 03 Feb 2026 19:43:54 GMT</pubDate></item></channel></rss>