#Golf Ball
1 messages · Page 1 of 1 (latest)
what does the direction of the camera have to do with the golf ball
do you have the golf ball working?
and the issue is with the camera following?
no
i wanna make result like this
so if player look in other direction it will shoot in cam direction
the shooting and the camera's position isn't really related
the camera follows the ball, and you can rotate the camera around the ball's position
and then i assume there's a sort of dragging which allows you to get the direction of where to shoot
can i just share cod
void Shoot(Vector3 Direction)
{
rb.AddForce(new Vector3(cam.transform.forward.x, cam.transform.forward.y, cam.transform.forward.z) * forceMultiplier);
}
this part here, you pass in the direction but it's never used
you should add force of direction.normalized * forceMultiplier
in ForceMode.Impulse because it's a one time shot
because it shouldn't be related to the direction of the camera
it should
what
it need to shoot in camera DIRECATION
you're calculating the direction based on the start and end of the drag
i need to calculate direction from cam
i'm not sure what direction you're trying to calculate
in that system the ball still doesn't move according to the camera, it moves according the start and end point of the drag
@nova raven Show your actual game footage and explain exactly what you want. then we can help
show YOUR game footage?
i didnt get what you want
a video of how it's currently working
send a video of your game
or you can use a site like streamable
ik
i can't really tell what's happening
why
Because its 7fps?
there's also a square covering a quarter of the screen
yeah
(sorry for pings v2)
You havent told the code to do that.
back*
it literally went backwards
are you talking about moments it came and go away from box?
I'm over it. You need to explain what you want. Or else i cant help
Dragging the mouse does nothing. youy're not using it
you're using camera.forward
Only.
you are not using mousepress or release
At all
ok can i just draw what i want