# How to attach a socket to actor using Python API?

**URL:** <https://forums.unrealengine.com/t/how-to-attach-a-socket-to-actor-using-python-api/720027>\
**Category:** Blueprint\
**Tags:** Python, unreal-engine, CPP, Blueprint, question\
**Created:** [December 2, 2022, 2:00pm UTC](https://forums.unrealengine.com/t/how-to-attach-a-socket-to-actor-using-python-api/720027 "2022-12-02T14:00:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronyshaji1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ronyshaji1](https://forums.unrealengine.com/u/ronyshaji1)\
**Post date:** [December 2, 2022, 2:00pm UTC](https://forums.unrealengine.com/t/how-to-attach-a-socket-to-actor-using-python-api/720027/1 "2022-12-02T14:00:01Z")

</div>

Hallo  
I am trying to attach a socket(whch is a blueprint) to the actor. But the error is throwing.

Here I am accessing the parent actor from the leevel

```auto
level_actors = unreal.EditorLevelLibrary.get_all_level_actors()
filtered_list = unreal.EditorFilterLibrary.by_actor_tag(level_actors, Car_tag, filter_type=unreal.EditorScriptingFilterType.INCLUDE)
actor = filtered_list[0]

```

Here setting the location for teh socket from a list.

```auto

cam_location = unreal.Vector(item['location']['x'], item['location']['y'], item['location']['z'])
cam_rotation = unreal.Rotator(item['rotation']['roll'], item['rotation']['pitch'], item['rotation']['yaw'])

```

Then loading socket using

```auto
ac = unreal.EditorAssetLibrary.load_blueprint_class('/Game/Resim/Blueprints/BP_Camera.BP_Camera')

```

Then after that i try to attach using:

```auto
unreal.Actor.attach_to_actor(actor, ac, cam_location, cam_rotation )

```

and finally got the error like:

> LogPython: Error: unreal.Actor.attach\_to\_actor(actor, ac, cam\_location, cam\_rotation )  
> LogPython: Error: TypeError: attach\_to\_actor() required argument ‘rotation\_rule’ (pos 4) not found
