…is not the way to do it, because I keep getting an error:
TypeError: a float is required
I have seen dir used before, but I am not getting it to come together.
What’s the correct way to get my character face the direction of the waypoint? Thanks
You try to create a new Point3 instance, with these arguments:
Point3( vector3, float, float )
There is no matching constructor for this (and I wouldn’t know what the resulting point should be). The “closest” constructor is this one, and this is probably why you get the error message “a float is required”:
Well, I understand what you are saying, but I don’t understand what to do.
The x coordinate part of Point3 is wrong. I just need to know what to put here for the object’s location.
Why is the X coordinate wrong? Anyway you can get and set positions piecewise. (i.e. [color=darkred]myNodePath.getX(); [color=darkred]myNodePath.setX(x)) This is all explained in the manual under the scene graph section.
I already used myNodePath.getX().
Sorry for not being clear. Let me explain a little more.
I am using intervals.
My model needs to face the direction of my waypoint (an object) during the interval. So my code I believe should be something like this:
So that my model turns on the x-axis only.
I tried many alternatives for my waypoint’s position, but I get the same error - TypeError: a float is required
Looks workable.
My model faces in the opposite direction though.
I know this is because of the direction my model was facing in the modeller when exported. (This is the case with the ralph model)
How can I get him to face the other direction, without altering his direction in my modeller?
This could be incorrect, but I believe you can use the command-line egg-trans function to rotate your model 180 degrees about its z-axis. This should fix the egg file.