Im trying to create a script whereby a sphere collider attached on hand(model) and able to pick up a box(rigidbody) and holding it whenever it touched. Currently, im able to make these two thing collide so that whenever the hand swing on the box and it would thrown away. I’ve tried collider.attachedRigidbody.AddForce(0,1,0) and it comes nothing to happen like i intended to do. Any suggestion to make my character holding an object after touched the box?
hereby my current script which i put it on hand(model):
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.name == "crate"){
theCollision.attachedRigidbody.AddForce(0,1,0);
}
}
Hey I have added 2 Script to Complete a full Grab toggle and ready to move code,
Fixed An Inversion Error and a Euler read error while moving. since yesterday it is now working as stated below
ObjectReplyIdAndLock, ObjectGrabIdAndMove
ObjectGrabIdAndLock goes on Main player,… ObjectReplyIdAndMove goes on Moveable Objects remember to add layers in you want to hit in inspector and pick the Headcam Ect
Updated Scripts Since the other week now with full movement And Rotation and Full Inversion Options
This is Complete bar Diagnals and Mouse Rotation as im adding this now, you want to use the option OverideDiagnals and possibly UseDefaultRotation if u hate my defualt.
too add mouse copy the whole auto inversion and paste it underneath and swap the names to the mouse names instead of the default keys its a mission dont attempt it lol. i will do this over the week as still cleaing up the script its pretty large, Please contact at Exvalid@gmail.com To give me job coding.
cheers Ryan kappeslink text Exvalid@gmail.com
[105510-objectgrabscripts.zip|105510]