generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: This is driving me nuts

Previous Thread :: Next Thread 
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2012 12:28 PM
 I've been two weeks attempting to make the character's head look at the position the mouse is pointing to, and I just can't get it to look at the right position.

 I posted another thread last week, but everyone started arguing about how CFrame worked and I couldn't solve the problem.

 I know the basics on CFraming. However, when it comes to welds, I get really messed up. Implying that Motor6D joints use a weird C0 to animate the character.

 Well, I'd really appreciate it if you pro scripters could help me. This is an important detail of the game, as I also want to make the arm aim to the right position and I don't want to leave it unmoving while it's mining.

 Oysi has accomplished this in his paintball game, and it works perfectly. The head looks at the right position and the arms move when you look up or down (but I just want to animate the right arm).
Here is the place: roblox.com/--item?id=12701322

This is how it would work if there were no welds.
   mouse.Move:connect(function()
        head.CFrame = CFrame.new(head.Position,mouse.Hit.p)
   end)

And this is the way I'm using right now, with welds:
   mouse.Move:connect(function()
        neck.C1 = CFrame.new(Vector3.new(),mouse.Hit.p) + Vector3.new(0,.5)
   end)
   > The head doesn't look at the right position

 And just a short question: if I don't use any tools but I want the arm to show up on first-person mode, should I just leave it as a child of workspace?

 Thank you very much for taking the time to read this. I hope you will help me.


 TL;DR: I need to make a character's head look at the position the mouse is pointing to by changing the C1 property of the neck joint.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
25 Nov 2012 12:38 PM
I can do this, just a moment.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
25 Nov 2012 12:41 PM
neck.C1 = CFrame.new(head.Position,mouse.Hit.p):inverse() * CFrame.new(neck.Part0.Position)
Report Abuse
robloxianof233 is not online. robloxianof233
Joined: 23 Nov 2012
Total Posts: 11
25 Nov 2012 12:42 PM
took you five minutes to do this?
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
25 Nov 2012 12:43 PM
No, it took me 5 hours and I went back in time.
Report Abuse
lucas668 is not online. lucas668
Joined: 18 Jun 2008
Total Posts: 6183
25 Nov 2012 12:45 PM
Your time machine was off by 5 minutes...
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
25 Nov 2012 12:48 PM
It always does that.
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
25 Nov 2012 12:51 PM
I don't get it.

What's the inverse function do to the CFrame's stuff?

Inverse of what?
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2012 12:53 PM
It didn't work, the head was floating like 100 studs away :l

This is so tricky.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
25 Nov 2012 01:22 PM
I don't get why it didn't work...
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2012 01:38 PM
Probably because of how C1 is set.
Report Abuse
robloxianof233 is not online. robloxianof233
Joined: 23 Nov 2012
Total Posts: 11
25 Nov 2012 01:40 PM
Prehistoricman, it took you five hours to make a small script that doesnt work. good job!
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2012 01:40 PM
@robloxian
gobwey pls
Report Abuse
robloxianof233 is not online. robloxianof233
Joined: 23 Nov 2012
Total Posts: 11
25 Nov 2012 01:41 PM
you dont even know who i am, you couldnt possibly eat me
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2012 01:42 PM
Yes, you're a failtroll. Have a nice day.
Report Abuse
robloxianof233 is not online. robloxianof233
Joined: 23 Nov 2012
Total Posts: 11
25 Nov 2012 01:43 PM
*facepalm*

you obviously dont even know what a troll is in the first place, or you wouldnt have suggested i was any form of troll.
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
25 Nov 2012 01:45 PM
No. Scripters... What are you doing. No, stop. Please, just stop. Scripters, please.

Augh. Not another argument.
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2012 01:49 PM
My point exactly, just ignore the troll.
Report Abuse
robloxianof233 is not online. robloxianof233
Joined: 23 Nov 2012
Total Posts: 11
25 Nov 2012 01:50 PM
yeah, well just have to ignore the ignorant fool.
Report Abuse
triston220 is not online. triston220
Joined: 08 Mar 2010
Total Posts: 1861
25 Nov 2012 01:56 PM
Guys, I can't even see the person who we're supposed to be ignoring. 0_o
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
25 Nov 2012 02:04 PM
Ignore the ignoring topic :l
Report Abuse
robloxianof233 is not online. robloxianof233
Joined: 23 Nov 2012
Total Posts: 11
25 Nov 2012 02:05 PM
the topic shall be answered!
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
25 Nov 2012 02:06 PM
So why didn't mine work? It follows the rule I've seen used in weld scripts and I used the exact same thing in other places.
Report Abuse
Multidimensional is not online. Multidimensional
Joined: 05 Apr 2012
Total Posts: 866
25 Nov 2012 02:07 PM
k thx i leik babies in my mouth dont u?

=== hacked by ur mum ===
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
25 Nov 2012 02:19 PM
@awsumpwner27

What he's really doing is converting CFrame.new(neck.Part0.Position) to CFrame.new(head.Position,mouse.Hit.p)'s object space.

¬ SHG Scripter Tier-2 ♣ LuaLearners Elite
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image