- Home /
how can make Ik targets following cursor?,,how can i make IK targets follow the cursor?
I hope, someone can help me. I want to have a mouse aim shooting in my game. So i've created character with rigging. Also there is 2d IK. Now targets from IK follow my cursor, but it doesn't correct, because my cursor should be a crosshair and shooting line is upper than cursor. I've tried to fix that
target[0].transform.position = new Vector2(mousePos.x - (shootPoint[0].position.x -effectorPos[0].position.x), mousePos.y - (shootPoint[0].position.y - effectorPos[0].position.y));
but character start lagging when cursor is too close to character,I hope, someone can help me. I want to have a mouse aim shooting in my game. So i've created character with rigging. Also there is 2d IK. Now targets from IK follow my cursor, but it doesn't correct, because my cursor should be a crosshair and shooting line is upper than cursor. I've tried to fix that
target[0].transform.position = new Vector2(mousePos.x - (shootPoint[0].position.x -effectorPos[0].position.x), mousePos.y - (shootPoint[0].position.y - effectorPos[0].position.y));
but character start lagging when cursor is too close to character
Your answer
Follow this Question
Related Questions
2d - Follow cursor by having object rotate around z-axis 1 Answer
Can you change the sprites of a 2d character rig (at runtime)? 1 Answer
Is it possible to not allow the in-game cursor through certain sprites? 1 Answer
2D Animation does not start 1 Answer
Sprite Rigs get freezed in T-Pose after build or Editor restart 1 Answer