|
| 22 Mar 2013 09:53 PM |
So, here's the sad part of my situation: I can't use Humanoids.
So in order to make my zombies move to a target human, I have to use an alternate method to :MoveTo().
I need a way of sensing how to move to a target human, without instantly teleporting the zombie straight to him.
Make sense?
So far I have:
-- script.Parent:MoveTo(target.Position, target) *HINT: THIS IS THE OLD CODE I NEED TO REPLACE* while script.Parent.Torso.Position ~= target.Position do script.Parent:MoveTo(Vector3.new()) wait(.1) end
Can anyone give me suggestions? They can be as long and complex as you want, as long as you think it will work. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 10:23 PM |
Possibly something to do with Rays?
I'm looking them up right now, and I think they may be exactly what I need. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 22 Mar 2013 10:25 PM |
If you're wanting a way to move something, other than using Humanoids and MoveTo (of the Humanoid) then look at BodyGyro and BodyPosition
BodyGyro can turn a part (and all the attached parts of it) to look at something, while BodyPosition can move (as if it were walking or being pushed) a part to a new position. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 10:37 PM |
BodyPosition you say?
I shall look into it. Thanks for your advice. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 10:39 PM |
But actually I do have a question.
Is BodyPosition like Hint, where it doesn't show up in Basic Objects?
Because I don't see it anywhere. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 10:40 PM |
| Oh, wait, never mind, I found it. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 10:52 PM |
Ok, I have a problem.
I went to the Wiki to learn more about BodyPosition and BodyVelocity.
I then put in a BodyPosition, and BodyVelocity into the 'Torso' of the Zombie, and used a position in front of the Zombie, but nothing moved.
To make sure it wasn't me doing something wrong, I put in a part and copied the BodyPosition and BodyVelocity into it, and then that worked just fine.
So what am I doing wrong?
The zombie has a figure much like a classic robloxian's, and all part surfaces are welded together. Like I stated before, there is no humanoid or Animate script controlling the Zombie,
So why won't anything move? |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 22 Mar 2013 10:54 PM |
Well, for one, I didn't say anything about BodyVelocity. That won't really do much in this situation.
Second, when you have a lot of parts, such as a figure, attached to one main one - you'll need more force. I believe there's a property called maxForce on the BodyPosition. Keep pushing those three numbers up until the figure moves. |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Mar 2013 10:59 PM |
| I don't think this is going to work like that, I've pushed up the values really high and nothing is moving. I also reduced the Dampening property and increased the Power property, and still nothing. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 22 Mar 2013 11:02 PM |
I see.
I'm willing to test it out and see what I can do if you give me the figure model you're using.
Also, can you tell me why you aren't using Humanoid? They can move without animation - which holds back a good amount of lag. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 11:06 PM |
I can give you the figure model that I'm using, I'll post back in a second when it's in my models.
I don't use Humanoid because I wish to make custom animations for my zombies, but Humanoid forcefully takes over and inserts Roblox animations, which breaks a key part of my game.
You see, when I use my custom animations the arms of the zombie hit an invisible brick on the defense window that starts to destroy the window a little more every time it is hit.
So, alas, I cannot use Humanoids.
|
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 11:07 PM |
| The zombie model is now in my models and free to the public, hopefully you can see what I'm doing wrong. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 22 Mar 2013 11:08 PM |
Humanoids don't actually forcibly use any animation. They are just objects to control figure position (movement) and GUI naming/health overheards.
All animations created in ROBLOX are custom via scripts. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 11:11 PM |
Well, I thought that was what happened because of the Animation object.
Anyways, my animations still don't work when I use them, and now I'm beginning to suspect the Hips and Shoulders.
Still, do you think you can fix my model? |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 22 Mar 2013 11:14 PM |
| The issue with your zombie not moving via Body objects is because the legs have Welded surfaces. If you lift the zombie up a bit, it will fly towards the position target. It's stuck to the ground, basically. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 11:15 PM |
OH,
*QUINTUPLE EPIC FACEPALM*
Let me see if I can fix that real quick. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 11:17 PM |
IT WORKS!!!!
OH THANK YOU MR. NIC NAC, YOU ARE A GENIUS IN YOUR OWN TIME.
|
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 22 Mar 2013 11:22 PM |
Hey, no problem. You were pretty fun to help out because you went and found some stuff out on your own instead of pestering me for it all.
I expect you'll need some help with BodyGyro later on - to get the zombie to turn to look at where's it's going - so just let me know somehow or post here again. |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2013 11:30 PM |
Ok, when I get to that stage I'll send you a PM or something.
Don't worry, I will try ALL THE WAYS to contact someone. (Which isn't always a lot of ways, but whatever) |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 22 Mar 2013 11:33 PM |
If anything though, you can find me more often on the LuaLearners website. That is, if I don't login here for a couple of a days at a time and no one else can help you.
Even then, if you happen to cross LuaLearners - anyone there could help you as well. Nice little live-chat dashboard wall for instant help usually. |
|
|
| Report Abuse |
|
|