我正在使用Ball, in开发棋盘游戏cocos3d。在那我已经给出了一个动作touchevent。我正在使用将位置打印到控制台NSLog()。
这是代码
-(void) touchEvent: (uint) touchType at: (CGPoint) touchPoint {     
CCActionInterval *BounceAction1=[CC3MoveTo actionWithDuration:0.1 moveTo:cc3v(0.0, -5.0, -0.7)];
switch (touchType) {
    case kCCTouchBegan:
        [Ball runAction:BounceAction1];
         NSLog(@"Location of x=%f and y=%f", Ball.globalLocation.x, Ball.globalLocation.y );
    break;
}
在这里,“球”是一个MeshNode. 它的位置在 origin cc3v(0.0, 0.0, 0.0)。
当我跑动和触球时,我发现球在移动到指定的位置。但我得到球的位置:
Location of x=0.000000 and y=0.000000
当我再次触摸时,我发现球没有移动(因为它已经移动到指定位置)。但随后它将 Ball 的位置显示为:
Location of x=0.000000 and y=-6.000000
为什么我第一次找不到位置?