Hello.
Im trying to make a bullet hell game and i have a character on screen.
The problem is that its position values never change even though the character is moving visually.
Any ideas why this is happening and how to fix it?
The code im using to move the player(located inside a local script):
player:PivotTo(player:GetPivot() * CFrame.new(directionY, directionX, 0))
Why are you using PivotTo?
This can be achieved the same way via Character:SetPrimaryPartCFrame(Cframe + angular)
Off the top of my head I don’t understand how this can be happening. Most possible way is that potentially you’re doing this from client side and Model position isn’t changing because of how PivotTo works which is making replication visibly being weird. Never seen this problem so Not exactly sure what caused it but still don’t see the reason for PivotTo with information given.
Instead of using PivotTo, I would look at Humanoid:Move or Humanoid:MoveTo on the server. My understanding of Pivot is that it changes the reference location of where parts are rotated or moved around. It makes sense when you think about it. Since you are changing the pivot instead of the position, the part will change locations in relation to the pivot, but the position will never change because the reference point (the pivot) is still in the same location. In other words, the pivot is the displacement of where the part is rendered in relation to the pivot.
In the above image, the position of the part is now referenced at the end instead of the middle because of the pivot point. Normally, the pivot point is in the geometric center of the block.
Now if you change the location of the pivot itself, then the position of the block will move.
1 Like
Are you referencing the Player or the Character?
Player service is a list of the players playing the game. It’s where you are loaded in when you join the game.
Your Character is what you move and control while playing the game.
Show us the entire script, not just one line of it so we can see what you are doing.
1 Like
Thanks! SetPrimaryPartCFrame works just fine.