12-16-2012, 02:19 PM
I think this is a glitch but I might be just misunderstanding the velocity objects
![[Image: glitchithink.png]](http://img502.imageshack.us/img502/9338/glitchithink.png)
I had the same problem with the VelocityController object
![[Image: glitchithink.png]](http://img502.imageshack.us/img502/9338/glitchithink.png)
I had the same problem with the VelocityController object
Poll: You do not have permission to vote in this poll. |
|||
Total | 0 vote(s) | 0% |
* You voted for this item. | [Show Results] |
Glitch with velocity
|
12-16-2012, 02:19 PM
I think this is a glitch but I might be just misunderstanding the velocity objects
![]() I had the same problem with the VelocityController object Code: gamePlayer = script.Parent.Parent.Parent
Try
newBullet:getChild("FixedVelocity").Velocity = Vec2D(-50, 0) [-100 is WHAM out of sight in a hundreth of a second.] ![]()
12-16-2012, 04:39 PM
I tried ghostys solution and got a different error saying Script:12: attempted index of a non-table
12-16-2012, 06:45 PM
Use game
![]() [lua] game ![]() newBullet = Bullet:clone() newBullet.Position = gunPosition newBullet.Rotation = gunAngle - 180 newBullet.FixedVelocity.Velocity = Vec2D(-100,0) --error here newBullet.Parent = game.World end) [/lua] (long, probably confusing explanation below) The problem is that scripts run separately from everything else. The game engine can only do one thing at a time (it can't add stuff while simulating physics, for example) so when you run a script that does something like cloning, adding, or removing stuff, it's actually telling the game to do it as soon as it's not busy. But the script won't wait for the game to be done, so 3 lines later the bullet's children won't have been added yet when the script asks for the one called FixedVelocity. Using game ![]() It would be better to just make all scripts use game ![]()
12-16-2012, 07:48 PM
thanks, it works fine now
|
« Next Oldest | Next Newest »
|