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 |
|
|
|
| 25 Nov 2012 12:38 PM |
| I can do this, just a moment. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 12:41 PM |
| neck.C1 = CFrame.new(head.Position,mouse.Hit.p):inverse() * CFrame.new(neck.Part0.Position) |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 12:42 PM |
| took you five minutes to do this? |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 12:43 PM |
| No, it took me 5 hours and I went back in time. |
|
|
| Report Abuse |
|
|
lucas668
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 6183 |
|
|
| 25 Nov 2012 12:45 PM |
| Your time machine was off by 5 minutes... |
|
|
| Report Abuse |
|
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 25 Nov 2012 01:22 PM |
| I don't get why it didn't work... |
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 25 Nov 2012 01:38 PM |
| Probably because of how C1 is set. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
| |
|
|
| 25 Nov 2012 01:41 PM |
| you dont even know who i am, you couldnt possibly eat me |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 25 Nov 2012 01:49 PM |
| My point exactly, just ignore the troll. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 01:50 PM |
| yeah, well just have to ignore the ignorant fool. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 25 Nov 2012 02:04 PM |
| Ignore the ignoring topic :l |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 02:05 PM |
| the topic shall be answered! |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 25 Nov 2012 02:07 PM |
k thx i leik babies in my mouth dont u?
=== hacked by ur mum === |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|