Model shaking a lot when colliding with the floorhandler only when its collisionray is above it?

I have the following code:

        guy1ray = self.guy.attachNewNode(CollisionNode('colNode'))
        guy1ray.node().addSolid(CollisionRay(0, 0, 13, 0, 0, -1))
        pusher = CollisionHandlerFloor()
        pusher.addCollider(guy1ray, self.guy)
        traverser = CollisionTraverser('traverser1')
        base.cTrav = traverser
        traverser.addCollider(guy1ray, pusher)

In here “guy” is the actor which is the parent of the camera and is controlled my custom hotkeys. When i put the collisionray below him he doesn’t shake at all but when i put it above him and it collides with something that is mostly diagonal the model starts shaking a lot.
I am a complete newbie to programming with this and i don’t know what to do so any help?

Do you by any chance have another collider attached to your character, one that the CollisionRay might be hitting?

That would explain why it behaves differently when above the character than when below: in the latter case, the ray, being entirely below the character, never encounters the other collider, while in the former case, being above the character, it passes down through the character encounters the other collider, and thus reacts to it.

By the way, you can use code-tags–see the menu-bar at the top of the text-entry box when posting–to add formatted code to your posts. This can make code rather easier to read, I find! See below for an example:

Text entered in the text-entry box: (Using the template provided by pressing the “Python” button on the posting menu-bar, just above the text-entry box.)

class Cat():
    def __init__(self):
        self.sound = "meow"

(With an extra “\” in order to convince the forum to show the `-characters at the end; omit that from actual use of the this feature.)


class Cat():
    def __init__(self):
        self.sound = "meow"

I am using the roaming ralph map and ralph model for the character, i don’t know if the ralph character has any collisions but i don’t see any collisions showing from it when i execute the code.

I also didn’t put any colliders other than the ray and the integrated ones from the map.

Hmm, okay, odd then!

In that case, I don’t know, I’m afraid. I don’t really use CollisionHandlerFloor, myself, and so have little experience of it. Perhaps another member of the community might have an idea!

By the way, thank you for adding code-tags to your first post! :slight_smile: