How to change body direction with camera/mouse?

  • What are you attempting to achieve? (Keep it simple and clear)
    I am attemping to achieve something like the this: https://gyazo.com/87a555d56369d9c9fba5de0646df8384
    Basically, to make the body and head follow the camera and mouse.
  • What is the issue? (Keep it simple and clear - Include screenshots/videos/GIFs if possible)
    No issue.
  • What solutions have you tried so far? (Have you searched for solutions through the Roblox Wiki yet?)
    I have done a lot of research. I also scripted something that made the whole body move according to the face direction but, it was very buggy and not what I was looking for. I have also heard you need to use something called math.atan2 and math.atan. But I havent learned those subjects in school yet (and dont know if I will).

So is there a ā€œsimpleā€ way of doing this while the gun is equipped?
Thanks for all the help!

2 Likes

This has something in is that has the character look where the camera is pointing.

Hope that helps!

10 Likes

You could do a first person. First person, they just will move with the direction of the mouse. Even though you may not want FP. Itā€™s just a suggestion. In the Gyazo GIF. Itā€™s not a FP. But, A simple change could do it?

2 Likes

Wow, thanks man!
I have read all of your Scripting Helpers and Roblox Wiki articles and tutorials - big fan of your work! BTW, would this also work with tools?

1 Like

but the guns would look a little weird. And I would have to do alot of stuff besides to make it look nice.

Most definitely. Someone in the same thread actually did exactly that!

3 Likes

Speaking of that, I could release my edit if @Oficcer_F or anyone wants it

4 Likes

That would be great! :smile:
Thanks!! It helps me out a lot, and you will definitely be in the credits! (Same with you EgoMoose)

1 Like

@EgoMoose and @Xiousa, thank you so much for the help so far! :smiley:

1 Like

Just a quick update, Iā€™ll release it later today. Iā€™m sorry, Iā€™ve been pretty busy the past week.

2 Likes

That would be awesome! Thank you so much :smile:
Looking forward to it!

Hey, I canā€™t find the script/model on your profile or on the Dev forum? Where did you publish it or did I somehow overlook it? :sweat_smile:

Hey, Iā€™m sorry, some family stuff happened recently. Iā€™ll try to release it today if I can.

1 Like

No problem, what is more important than family right? Hopefully it works out!
Take your time, anyways looking forward to using it :slight_smile:

Hi Xiousa, hope the family stuff is ok!
Have you thought about releasing the script in the near future?
Best regards

Iā€™m gonna be honest, I completely forgot about this, sorry.

Iā€™ve put everything into an empty baseplate which you can find below, just move everything to their respective location.

LookAtMouse.rbxl (39,0 Ko)

6 Likes

Thank you so much! I really appreciate it! No problem that you forgot about it!
Sincerely

Hey this is from a while ago but I saw your post while looking for the answer myself and I think Iā€™ve found it. You might want to try RotationType.CameraRelative.

1 Like