i’m trying to make a game where you are able to spawn creatures, when you press a button a prefab will be shown in front of the player, and it should move and rotate with the players point of view.
i’m new to unity and coding in general can someone give me a pointers to how to go about this? i can successfully instatiate the gameobject but i have no idea how to make the gameobject move as my player is moving. And stop moving when the player presses “Fire1”
thanks in advance, any help is greatly appreciated!
This one should be fairly straight forward,
Store the camera in a Transform variable. In the Start() function, get the camera game object with gameObect.FindWithTag(“MainCamera”).transform;
an then attach the creature object to the camera using transfom.parent = camObject and then match its transform, then just at roughly 10 units to he Z Axis.
Then as soon as Fire1 is click, set parent to null.
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
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[105515-objectgrabscripts.zip|105515]