Local transformation doesn't work

Trying to learn some Python, so I’m making a game with a ball (yeah, that’s an original idea, huh?)
Anyway, I have a ball and it moves with the arrow keys using this script, which is not completely mine, I had help in another thread to get it right:

import GameLogic 





xValue = 0.0
yValue = 0.0
if up.isPositive():
   xValue = 2.0
if down.isPositive():
   xValue = -2.0
if right.isPositive():
   yValue = 2.0
if left.isPositive():
   yValue = -2.0

I also have a hat for my ball, which is attached to the ball by vertex parenting.
Then the camera is parented to the hat.
I have another script which uses the AKEY and DKEY to rotate the hat, which in turn changes the view from the camera.
But then when I use the up arrow to move the ball, it doesn’t go up on the screen(away from the camera), it keeps going in the direction that up was before the view changed.
So I’ve tried turning the Local Transformation on and off for the ball, but neither way will make up continue to move away from the camera regardless of the view.
Any suggestions for this?

Haven’t messed with camera’s much, but what it does seems logical. It’s moving up and down. That’s what you programmed it to do and that’s what it’s doing. The camera isn’t going to affect that. It’s just showing a different viewpoint of what’s going on.

Did you change the local transformation in the actuator itself or in python? Your settings being setforce(X,Y,Z,0 or 1) I may not understand the problem though.

I changed the transformation in the actuator, not in python.
Fireside is right, though, all the camera is doing is showing a different view of what’s going on.
From what I’ve read, would getOrientation() and setOrientation() do the trick? Is there a way to set the orientation to follow the camera around so that when I do press the up arrow the ball continues to roll away from the camera?

To answer the question for anyone who might fall on this forum and be having problems with the local transformation, I found myself progamming in python the setforce(0, 10, 0, 0) not realizing that the last zero was the local transformation variable. Set it to 1 and your good to go.

I’m not sure how to answer your Q. sorry. :frowning: