So should I be adding or removing half the size of the hand to the origin or somewhere else?
Depends, if you want to offset the Origin of the Ray, then add the half size of Hand (up)
If you want to offset the final distance, then subtract the half size of Hand (down)
Iāve got to go to bed now but, Iāll provide you with this new place file with updated code and stuff for you to test and mess around if you want to. I was kind of in a rush because I was a bit late to go to bed and it was kind of confusing me of what you were meaning lol
Iāll continue to work on it tomorrow night
Just so I donāt have to make another post, would it also be possible if you help make the target angle of the hand in the hinge to be the same as the rotation of the wire Iām having a little trouble explaining what Iām trying to do to chat GBT lol. The issue might be because when the pantograph raises the angle of the hand will also make it look different but stay the same if you know what I mean.
Thank you for your help.
Hello!
Iāve been working on a couple things for the pantograph and a test I have ran was if the pantograph isnāt center with the wire on its Z axis then it wonāt find the wire thatās above the pantograph so would there be a way to fix this issue or do the pantograph and wire have to be centered on its X axis?
Another issue Iām having is that the pantographs hand is gone halfway through the wire, is there any way to fix this?
Have you taken a look at the new test file I sent you last night?
I changed the hinges target angle manually that is why its aligned with the wires orientation, so Iām still needing to figure out how to automatically do which might be a challenge lol.
Nope sorry, I did not check it. Iāve been busy. If you wish send me the new file and I could take a look right now
Thatās ok.
The file is in the quote below.
So you didnt made any changes or progress compared to file of yesterday? or you edited it to include the new one?
Iāve updated the first file I sent you, which the update file is the quoted part. If its not the updated one then let me know and I will resend it.
I think the issue with the hands got something to do with me using the * symbol instead of the + symbol because it prints different numbers. Using the * symbol prints out 15 and using the + symbol prints out 11 but for some reason using the plus symbol will not work in the raycast. If this is any help to you.
Iāve spent about three hours working on it and Iāve gotten no where so I will have to try again tomorrow. I should have a lot more time to work on the pantograph tomorrow and Sunday. I have no idea why the pantograph is not going to the correct height. The top of the hand has to touch the bottom of the wire that is above the wire. Iām not sure if it has to do with something the calculations chat GBT has given me, I have tried to get it to give calculate it/re code it but that also did not work.
Let me know how you get on when you have the time to try.
Mhh. I tested your file, and I suggest change the approach entirelyā¦
Even if you make it work, it will cause lot of issues when the train is moving, at least its what I think. In this video Im using raycast yes, but, the hinges are not Servos. the height of the Hand its based on Hit.Position, not Distance, the Hand is raised by Motor6D so the Train can move while changing the Hand height based on Raycasting to always get the final position when hits the wire.
Plus, the hinges that you positioned based on the mesh, are very likely to fail, those hinges doesnt really know the shape of your meshesā¦
Honestly its the first time I tried to do this. But, on my side its kinda working, but I should to rebuild your pantograph mesh entirely and make my own based on parts and just using meshes to replace the visuals of the modelā¦
My approach is not finished yet, needs more work, but I dont have more free time to do this.
If you cant watch the video I suggest you download itā¦
This looks more like something that should be solved by IK joints, Im not really experienced on that, I clearly remember someone who is awesome on that topic and its very active on forum, I hope not being rude by taggingā¦ they could be busy, @dthecoolest
Oh thank you for your test and your approach. The pantograph on the train that moves that can raise up but without looking for the wire just falls down when the train moves lol.
I have no idea what IK joints are but I have seen developers name their animations IK (animation name)
One other issue there is if the wire and pantograph arenāt on the same axis left and right then the raycast wonāt detect the wire since it casts from the centre or the pantograph. Would there be a way to fix this?
Do you think you could provide me with your version of the place file or a model? I might be able to finish working on it.
Thanks your all the help.
Iāve just watched the video again, and Iāve noticed that the thingy for the hinges are shown there right at the start, are they disabled or are they something that helps with it?
Sure, but I would like to work a lil bit more on the approach cause I got a weird placement of the hinges, going to one side, like being splited.
Are disabled, those just works as anchor points that can be rotated, the only thing actually moving is the hand going to Hit.Position, and the arms are just pulled by the Hand
Ahhh ok, thanks! Once your finished and youāve sent it to me then Iāll probably do a couple things then Iāll apply it to the train and then send a video of it to you.
Oh ok, so do the hinges still move but only controlled by the hand?
Yeah, its like pulling a box with a rope attached, the rope just bends according to the box, if you pull it upwards it extends if you bring it downwards it retracts. The rope has none control over the hand, the hand controls the rope
Yup, I got you.
Quick question but do you know how long it might take you to fix weird bug you were wanting to fix? No rush because Iām working the GUI side of the train.
Also a raycast issue Iāve had is if the wire and pantograph arenāt on the same X axis then the raycast wonāt detect any wires since it casts from the centre or the pantograph. How would I fix this?
Some vids:
Seems that rotation on any axis doesnt affect the expected behaviour:
This looks really good and cool.
Sorry, I meant if the pantographs X axis in position isnāt the same as the wires X axis in position that the raycast wonāt detect it. This was only a problem on my version so Iām not sure if it would be a problem on your version either.
Would you like to see the pantograph in action on the real moving train when I add your version of the pantograph to it?
Why the raycast wont detect the wires? if the āwiresā is a wide collision box? Remember that I told you that the wires are just visuals? the collisionBox should be the one that gets the hit, and the collisionBox is as wide as all wires.
Nope, its not, cause there is a collisionBox which is wide.
What do you mean by āreal moving trainā?
The videos I sent indeed has a real moving train on any possible axis. Yeah I know this approach will work with the train moving by script on any possible rotation and always positioning the pantoHand in its proper place (touching the wires)