Jump to content

Trying to figure out how to position a cellphone to look like recording


Fogest

Recommended Posts

Okay so I am trying to get a person that looks like they are holding a phone recording a video with it. Based on some things I have seen on these forums I managed to get what you see in the image below so far. Is there some way to figure out which vector3 values or rotator3 values to use? I tried using a trainer in the game to spawn in an object, and I can get values but those don't help as the person moves around so those positions can change. Is there some proper way to do this? I have included my code I have to do this below:


 

Object phone = new Object("prop_npc_phone", Vector3.Zero);
if (phone.Exists()) 
  phone.AttachTo(ped, ped.GetBoneIndex(PedBoneId.LeftHand), new Vector3(, -0.5619f, -0.5837f), new Rotator(-15f, -2.414763f, 3.98779f));


ped.Tasks.PlayAnimation("cellphone@", "cellphone_photo_idle", 1.3f, AnimationFlags.Loop | AnimationFlags.UpperBodyOnly | AnimationFlags.SecondaryTask);
ped.BlockPermanentEvents = true;

 

spacer.png

Link to comment
Share on other sites

I ended up getting it. Per a suggestion on a Discord I made use of Menyoo's Object Spooner, which is now apart of Menyoo PC as a trainer. With  this trainer I was able to turn on the object spooner mode and spawn in the npc cellphone. I then could choose an option right in the trainer to "attach" the phone to another entity. I had added the ped to the database already in Menyoo's PC so I was able to attach the phone to the ped. I could then adjust the phone to be attached to the leftHand bone id just like I did in the code. From here I was able to update the xyz and rotator values right from the trainer and see the changes live. I was able to position the phone nicely in the hand. 

 

I then just put the values I figured out in the trainer, right into my codes vector3 and rotator values and poof the result of that is what you see in the image below. I would highly suggest anyone else working on a similar issue to use the object spooner. It allowed me to quickly figure out the values needed. 

 

spacer.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...