Is it possible to extract the information from .getSurfaceNormal or .getSurfacePoint functions as separate variables? (Answered, Solved)

So I have been going at it since yesterday trying to the get positional numbers out of “Vector3f”'s parentheses and into separate variables to perform a task on, but I have had no success, I have tried to split lists, find item in lists, ect. but nothing.

I have even tried the .getX(), .getY(), and .getZ() after the .getSurfaceNormal/.getSurfacePoint to see if I can narrow them one by one, but no, so I ask, is it possible to retrieve this information and apply it into separate variables?

I’ll provide a sample of my problem in 30 minutes. thank you to anyone who helps.

Edit: okay, sorry for the wait, had dinner, here it is: vecrecdemo.zip (492.5 KB)

.getX(), getY(), getZ() should work, you could also use some of the other methods of getting the values of a vector

>>> from panda3d.core import Vec3
>>> v=Vec3(1,2,3)
>>> v
LVector3f(1, 2, 3)
>>> x,y,z=v
>>> x
1.0
>>> y
2.0
>>> z
3.0
>>> v.x
1.0
>>> v.y
2.0
>>> v.z
3.0
>>> v[0]
1.0
>>> v[1]
2.0
>>> v[2]
3.0
>>> list(v)
[1.0, 2.0, 3.0]
>>> tuple(v)
(1.0, 2.0, 3.0)

let me clarify myself, I forgot to mention I attempted to try them all at once, they work individually, but I need all 3 values in 3 different variables not 1 value, but I’ll try your other method a now, thank you for the example.

Okay so wezu, you were correct, it was me not understanding how to properly incorporate logic into functions that were meant to be event entries, as I was trying to use them as key press functons instead of event entry functions.

Though, I was little disappointed in the results seeing as the vectors seem to be not accurate enough, so I went with a mixed approach of jamming detection of character’s Z position for falling and vectors for walls, I hope it continues to work, here is a little demo: vecupdatedemo.zip (590.2 KB)