Altering Collision Segments for a Hook Mechanic

Howdy all!

I am currently making a game in Panda that is very similar to Bionic Commando, where you swing around a level using hooks from your character’s hands. I wish to use a Collision Segment to determine if the player can attach their hook to a ceiling based on the distance between the ceiling and the player.

Now, I am having problems with the Collision Segment with altering the length of the ray since I cannot seem to change either Point A or B of the segment after attaching the solid to a node path.

What would be the best way of going about this?

segment.setPointA() and segment.setPointB() work fine for me. Does it not work for you?


I had already added the Collision Segment to its own Node Path, and I was trying to alter it using the getSolid method without realising that the resultant solid from that method was constant. However, changing the method to modifySolid fixed that.